UNIT 4 CN

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

UNIT 5

Transport Layer
o The transport layer is a 4th layer from the top.
o The main role of the transport layer is to provide the communication services
directly to the application processes running on different hosts.
o The transport layer provides a logical communication between application
processes running on different hosts. Although the application processes on
different hosts are not physically connected, application processes use the
logical communication provided by the transport layer to send the messages to
each other.
o The transport layer protocols are implemented in the end systems but not in
the network routers.
o A computer network provides more than one protocol to the network
applications. For example, TCP and UDP are two transport layer protocols that
provide a different set of services to the network layer.
o All transport layer protocols provide multiplexing/demultiplexing service. It also
provides other services such as reliable data transfer, bandwidth guarantees,
and delay guarantees.
o Each of the applications in the application layer has the ability to send a
message by using TCP or UDP. The application communicates by using either
of these two protocols. Both TCP and UDP will then communicate with the
internet protocol in the internet layer. The applications can read and write to
the transport layer. Therefore, we can say that communication is a two-way
process.

The services provided by the transport layer protocols can be divided into five
categories:

o End-to-end delivery
o Addressing
o Reliable delivery
o Flow control
o Multiplexing
UDP Protocol-

• UDP is short for User Datagram Protocol.


• It is the simplest transport layer protocol.
• It has been designed to send data packets over the Internet.
• It simply takes the datagram from the network layer, attaches its header and sends it to
the user.

Characteristics of UDP-

• It is a connectionless protocol.
• It is a stateless protocol.
• It is an unreliable protocol.
• It is a fast protocol.
• It offers the minimal transport service.
• It is almost a null protocol.
• It does not guarantee in order delivery.
• It does not provide congestion control mechanism.
• It is a good protocol for data flowing in one direction.

Need of UDP-

• TCP proves to be an overhead for certain kinds of applications.


• The Connection Establishment Phase, Connection Termination Phase etc of TCP
are time consuming.
• To avoid this overhead, certain applications which require fast speed and less overhead
use UDP.

UDP Header-

The following diagram represents the UDP Header Format-


1. Source Port-

• Source Port is a 16 bit field.


• It identifies the port of the sending application.

2. Destination Port-

• Destination Port is a 16 bit field.


• It identifies the port of the receiving application.

3. Length-

• Length is a 16 bit field.


• It identifies the combined length of UDP Header and Encapsulated data.

Length = Length of UDP Header + Length of encapsulated data

4. Checksum-

• Checksum is a 16 bit field used for error control.


• It is calculated on UDP Header, encapsulated data and IP pseudo header.
• Checksum calculation is not mandatory in UDP.

Applications Using UDP-


Following applications use UDP-

• Applications which require one response for one request use UDP. Example- DNS.
• Routing Protocols like RIP and OSPF use UDP because they have very small amount of
data to be transmitted.
• Trivial File Transfer Protocol (TFTP) uses UDP to send very small sized files.
• Broadcasting and multicasting applications use UDP.
• Streaming applications like multimedia, video conferencing etc use UDP since they
require speed over reliability.
• Real time applications like chatting and online games use UDP.
• Management protocols like SNMP (Simple Network Management Protocol) use UDP.
• Bootp / DHCP uses UDP.
• Other protocols that use UDP are- Kerberos, Network Time Protocol (NTP), Network
News Protocol (NNP), Quote of the day protocol etc.

Transmission Control Protocol-

• TCP is short for Transmission Control Protocol.


• It is a transport layer protocol.
• It has been designed to send data packets over the Internet.
• It establishes a reliable end to end connection before sending any data.

Characteristics Of TCP-

Point-01:

TCP is a reliable protocol.

This is because-

• It guarantees the delivery of data packets to its correct destination.


• After receiving the data packet, receiver sends an acknowledgement to the sender.
• It tells the sender whether data packet has reached its destination safely or not.
• TCP employs retransmission to compensate for packet loss.

Read More- TCP Retransmission

Point-02:
TCP is a connection oriented protocol.

This is because-

• TCP establishes an end to end connection between the source and destination.
• The connection is established before exchanging the data.
• The connection is maintained until the application programs at each end finishes
exchanging the data.

Point-03:

TCP handles both congestion and flow control.

• TCP handles congestion and flow control by controlling the window size.
• TCP reacts to congestion by reducing the sender window size.

Read More- TCP Congestion Control

Point-04:

TCP ensures in-order delivery.

• TCP ensures that the data packets get deliver to the destination in the same order they
are sent by the sender.
• Sequence Numbers are used to coordinate which data has been transmitted and
received.

Point-05:

TCP connections are full duplex.

• TCP connection allows to send data in both the directions at the same time.
• So, TCP connections are Full Duplex.
Point-06:

TCP works in collaboration with Internet Protocol.

• A TCP connection is uniquely identified by using-


Combination of port numbers and IP Addresses of sender and receiver.

• IP Addresses indicate which systems are communicating.


• Port numbers indicate which end to end sockets are communicating.
• Port numbers are contained in the TCP header and IP Addresses are contained in the IP
header.
• TCP segments are encapsulated into an IP datagram.
• So, TCP header immediately follows the IP header during transmission.

Point-07:

TCP can use both selective & cumulative acknowledgements.

• TCP uses a combination of Selective Repeat and Go back N protocols.


• In TCP, sender window size = receiver window size.
• In TCP, out of order packets are accepted by the receiver.
• When receiver receives an out of order packet, it accepts that packet but sends an
acknowledgement for the expected packet.
• Receiver may choose to send independent acknowledgements or cumulative
acknowledgement.
• To sum up, TCP is a combination of 75% SR protocol and 25% Go back N protocol.

Point-08:

TCP is a byte stream protocol.

• Application layer sends data to the transport layer without any limitation.
• TCP divides the data into chunks where each chunk is a collection of bytes.
• Then, it creates a TCP segment by adding IP header to the data chunk.
• TCP segment = TCP header + Data chunk.
Point-09:

TCP provides error checking & recovery mechanism.

TCP provides error checking and recovery using three simple techniques-

1. Checksum
2. Acknowledgement
3. Retransmission

Differences b/w TCP & UDP

Basis for TCP UDP


Comparison

Definition TCP establishes a virtual circuit UDP transmits the data directly to the de
before transmitting the data. without verifying whether the receiver is
not.

Connection Type It is a Connection-Oriented It is a Connectionless protocol


protocol
Speed slow high

Reliability It is a reliable protocol. It is an unreliable protocol.

Header size 20 bytes 8 bytes

acknowledgement It waits for the acknowledgement of data and has It neither takes the ackno
the ability to resend the lost packets. retransmits the damaged

You might also like