Skip to content

Transport and Application Layers

Introduction to the Transport and Application Layers

  • Transport Layer Allows traffic to be directed to specific network applications

  • Application Layer Allows these applications to communicate in a wau they understand

The Transport Layer

  • Processes -> Multiplexer -> IP

  • Processes -> Demultiplexer -> IP

  • Port A 16-bit number that’s used to direct traffic to specific services running on a networked computer

  • 10.1.1.100

  • 10.1.1.100:80 - Socket number or socket port

  • File Transfer Protocol

  • Port 21

  • 10.1.1.100:21

Dissection of a TCP Segment

  • TCP Segment Made up of a TCP header and a data section
TCP Segment Header (20 Bytes)
Bit Position0 - 1516 - 31
0Source port (16)Destination port (16)
32Sequence number (32)
64Acknowledgment number (32)
96Header Length (4)empty (6)
128Checksum (16)Urgent (16)
160Options (0 or 16)Padding
192+Data payload (varies)
  • Destination port
    The port of the service the traffic is intended for

  • Source port A high-numbered port chosen from a special section oof ports known as ephemeral ports

  • Sequence number A 32-bit number that’s used to keep track of where in a Sequence of TCP segments this one is expected to be

  • Data offset field A 64-bit number that communicates how long the TCP header for this segment is

  • TCP Window Specifies the range of sequence numbers that might be sent before an acknowledgement is required

  • TCP Checksum Operates just like the checksum fields at the IP and ethernet level

  • Urgent pointer field Used in conjunction with one of the TCP control flags to point out particular segments that might be more important than others

  • Options field It is sometimes used for more complicated flow control protocols

TCP Control Flags and the Three-way Handshake

  • URG(urgent) A value of one here indicates that the segment is considered urgent and that the urgent pointer field has more data about this

  • ACK(acknowledged) A value of one in this field means that the acknowledgement number field should be examined

  • PSH(push) The transmitted device wants the receiving device to push currently-buffered data to the application on the receiving end as soon as possible

  • RST(reset) One of the sides in a TCP connection hasn’t been able to properly recover from a series of missing or malformed segments.

  • SYN(synchronize) It’s used when first establishing a TCP connection and makes sure the receiving end knoes to examine the sequence number field

  • FIN(finish) When this flag is set to one, it means the transmitting computer doesn’t have any more data to send and the connection can be closed

  • Three way Handshake Computer A -> SYN, SYN/ACK, ACK -> Computer B

  • Handshake A way for two devices to ensure that they’re speaking the same protocol and will be able to understand each other

  • Four way Handshake Computer A -> FIN, ACK,FIN, ACK -> Computer B

TCP Socket States

  • Socket The instantiation of an end-point in a potential TCP connection

  • Listen A TCP socket is ready and listening for incoming connections

  • SYN_SENT A synchronization request has been sent, but the connection hasn’t been established yet

  • SYN_RECEIVED A socket previusously in a LISTEN state has received a synchronization and sent a SYN/ACN back

  • ESTABLISHED The TCP connection is in working order and both sides are free to send each other data

  • FIN_WAIT A FIN has been sent, but the corresponding ACK from the other end hasn’t been received yet

  • CLOSE_WAIT The connection has been closed at the TCP layer, but that the application that opened the socket hasn’t released its hold on the socket yet

  • CLOSED The connection has been fully terminated and that no further communication is and that no further communication is possible

Coonection-oriented and Connectionless Protocols

  • Connectionless Protocols Established a connection, and uses this to ensure that all data has been properly transmitted

  • User datagram Protocol

Firewalls

A device that blocks traffic that meets certain criteria

The Appllication Layer

  • payload

  • Chrome

  • Internet Explorer

  • Safari

  • Microsoft IIS

  • Apache

  • nginx

  • HTTP

  • FTP

The Application Layer and the OSI model

  • Open Systems Interconnection

  • Session layer Facilitating the communication between actual applications and the transport layer

  • Takes appllication layer data and hands it off to the presentation layer

  • Presentation Layer Responsible for making sure that the unencapsulated application layer data is able to understood by the application in question

All the layers working in Unison

  • Diagrams