OSI Model – The Transport Layer

Posted: September 4, 2011 in Theory

The transport layer can be found in both the OSI Model and the TCP/IP Model. The two most common protocols in the transport layer are User Datagram Protocol (UDP) and Transmission Control Protocl (TCP).

UDP

  • Connectionless
  • Best effort delivery
  • Unreliable – here is the data

UDP is a very simple protocol that is not reliable, nor does it provide data intgretiy or guarantee transmission of data. UDP assumes that error checking and correction will be provided by the upper layers in the OSI model (Application Layer), thereby avoiding processing overhead at the network layer. UDP is especially useful in time sensitive applications such as VOIP, where dropping packets is preferable to waiting for delayed packets.

TCP

  • Connection orientated – establishes a session using the 3-way handshake
  • Reliable – uses acknowlegements and will continue to retransmit until an ACK is received
  • Maintains connections – utilises sequence numbers

Simple TCP Transmission between a client and a server – 3-way handshake
The client inititiates the session by sending a SYN packet to synchronise the conversation.
The server receives the SYN packet and responds with a SYN-ACK. This response states that the server synchornises with the client and they acknowledge the packet.
The client now sends an ACK stating they received the SYN-ACK and the connection is now established.

3 way handshake

After the 3-way handshake
After the session is established via the 3-way handshake, the client and server can begin to send data. Sequence numbers are used to identify each segment of data as it is transferred between the two devices and are used to identify the order of segments. This allows the data to be reconstructed in order, regardless of any fragmentation, disordering or packet loss that may occur during transmission.

In the following example the client sends the first segment with sequence number 7. Once the server receives the segment, it sends its data back to the client with its own sequence number (in this case 14) and it also responds with acknowledgement 8 which is the next expected sequence number from the client. This process continues throughout the entire session.

In the event that one of the sessions is lost between the client and the server and either device does not receive the expected Sequence Number within a pre-determined period of time, the sender will retransmit the data.

TCP Windows
TCP Windowing allows the amount of data sent between the two devices to increase based on how reliable the link is as the window size continually increases until a problem arises. TCP also utilises “Sliding Windows” which allows the session window size to be continually adjusted.

Port Numbers
When a TCP or UDP session is generated port numbers are used to distinguish between different applications. Port numbers can range from 0 to 65535 and the Internet Assigned Numbers Authority (IANA) are responsible for maintaining the list of common port numbers 0 – 1023.

Common TCP Ports
21 – FTP
22 – SSH
23 – TELNET
25 – SMTP
53 – DNS
80 – HTTP
110 – POP3
443 – HTTPS

Common UDP Ports
53 – DNS
69 – TFTP

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s