Transport Layer
Transport Layer
Transport layer offers peer-to-peer and end-to-end connection between two processes on
remote hosts. Transport layer takes data from upper layer (i.e. Application layer) and then
breaks it into smaller size segments, numbers each byte, and hands over to lower layer
(Network Layer) for delivery.
Functions
• This Layer is the first one which breaks the information data, supplied by
Application layer in to smaller units called segments. It numbers every byte in
the segment and maintains their accounting.
• This layer ensures that data must be received in the same sequence in which
it was sent.
• This layer provides end-to-end delivery of data between hosts which may or
may not belong to the same subnet.
• All server processes intend to communicate over the network are equipped
with well-known Transport Service Access Points (TSAPs) also known as port
numbers.
End-to-End Communication
A process on one host identifies its peer host on remote network by means of TSAPs, also
known as Port numbers. TSAPs are very well defined and a process which is trying to
communicate with its peer knows this in advance.
For example, when a DHCP client wants to communicate with remote DHCP server,
it always requests on port number 67. When a DNS client wants to communicate
with remote DNS server, it always requests on port number 53 (UDP).
The two main Transport layer protocols are:
• Transmission Control Protocol
It provides reliable communication between two hosts.
• User Datagram Protocol
It provides unreliable communication between two hosts.
Features
• TCP is reliable protocol. That is, the receiver always sends either
positive or negative acknowledgement about the data packet to the
sender, so that the sender always has bright clue about whether the
data packet is reached the destination or it needs to resend it.
• TCP ensures that the data reaches intended destination in the same
order it was sent.
• TCP is connection oriented. TCP requires that connection between two
remote points be established before sending actual data.
• TCP provides error-checking and recovery mechanism.
• TCP provides end-to-end communication.
• TCP provides flow control and quality of service.
• TCP operates in Client/Server point-to-point mode.
• TCP provides full duplex server, i.e. it can perform roles of both receiver
and sender.
Header
The length of TCP header is minimum 20 bytes long and maximum 60 bytes.
Addressing
TCP communication between two remote hosts is done by means of port numbers
(TSAPs). Ports numbers can range from 0 – 65535 which are divided as:
Requirement of UDP
A question may arise, why do we need an unreliable protocol to transport the data?
We deploy UDP where the acknowledgement packets share significant amount of
bandwidth along with the actual data. For example, in case of video streaming,
thousands of packets are forwarded towards its users. Acknowledging all the
packets is troublesome and may contain huge amount of bandwidth wastage. The
best delivery mechanism of underlying IP protocol ensures best efforts to deliver its
packets, but even if some packets in video streaming get lost, the impact is not
calamitous and can be ignored easily. Loss of few packets in video and voice traffic
sometimes goes unnoticed.
Features
• UDP is used when acknowledgement of data does not hold any
significance.
• UDP is good protocol for data flowing in one direction.
• UDP is simple and suitable for query based communications.
• UDP is not connection oriented.
• UDP does not provide congestion control mechanism.
• UDP does not guarantee ordered delivery of data.
• UDP is stateless.
• UDP is suitable protocol for streaming applications such as VoIP,
multimedia streaming.
UDP Header
UDP header is as simple as its function.
UDP application
Here are few applications where UDP is used to transmit data:
• Domain Name Services
• Simple Network Management Protocol
• Trivial File Transfer Protocol
• Routing Information Protocol
• Kerberos