3. INTRODUCTION
• It is recognized in OSI as well
as TCP/IP model
• It is responsible for source to
destination delivery of entire
message
• Transport layer ensures that
the whole message arrives
intact and in order,
overseeing both flow and
error control at source as
well as destination level
• Transport Layer is
responsible for delivery of
entire message from one
process running on source to
another process running on
destination.
4. UDP Header Format
•The transport layer is represented by two protocols: TCP and UDP.
•UDP is a part of the Internet Protocol suite, referred to as UDP/IP suite. Unlike
TCP, it is an unreliable and connectionless protocol.
•So, there is no need to establish a connection prior to data transfer.
•The UDP helps to establish low-latency and loss-tolerating connections establish
over the network.
•The UDP enables process to process communication.
5. UDP Header Format
•UDP header is an 8-bytes fixed and simple header, while for TCP it may vary
from 20 bytes to 60 bytes.
•The first 8 Bytes contains all necessary header information and the remaining
part consist of data.
•UDP port number fields are each 16 bits long, therefore the range for port
numbers is defined from 0 to 65535
•Port number 0 is reserved
• Port numbers help to distinguish different user requests or processes.
6. UDP Header
Format
• Source Port: Source Port is a 2 Byte
long field used to identify the port
number of the source.
• Destination Port: It is a 2 Byte long
field, used to identify the port of the
destined packet.
• Length: Length is the length of UDP
including the header and the data. It is
a 16-bits field.
• Checksum: Checksum is 2 Bytes long
field. It is the 16-bit one’s complement
of the one’s complement sum of the
UDP header, the pseudo-header of
information from the IP header, and
the data, padded with zero octets at
the end (if necessary) to make a
multiple of two octets.
7. Per-Segment
Checksum
• UDP Checksum calculation is similar to
TCP Checksum computation. It’s also a
16-bit field of one’s complement of
one’s complement sum of a pseudo
UDP header + UDP datagram.
• Here the checksum includes three
sections: a pseudo header, the UDP
header, and the data coming from the
application layer.
• The pseudo header is the part of the
header of the IP packet in which the
user datagram is to be encapsulated
with some fields filled with 0s If the
checksum does not include the pseudo
header, a user datagram may arrive
safe and sound. However, if the IP
header is corrupted, it may be
delivered to the wrong host.
8. Per-Segment Checksum
• Sender side:
• It treats segment contents as sequence of 16-bit integers.
• All segments are added. Let's call it sum.
• Checksum: 1's complement of sum.(In 1's complement all 0s are converted into 1s and all 1s are
converted into 0s).
• Sender puts this checksum value in UDP checksum field.
9. Per-Segment Checksum
• Receiver side:
• Calculate checksum
• All segments are added and then sum is added with sender's checksum.
• Check that any 0 bit is presented in checksum. If receiver side checksum contains any 0 then
error is detected. So the packet is discarded by receiver.
10. TCP: Connection management
Connection establishment is
performed by using the three-way
handshake mechanism. A three-way
handshake synchronies both ends of a
network by enabling both sides to
agree upon original sequence
numbers.
This mechanism also provides that
both sides are ready to transmit data
and learn that the other side is
available to communicate.
11. Reliability and Data Transfer
It uses a checksum to detect errors. The receiver sends
acknowledgement message if the message is complete,
and if the message is incomplete, it sends a negative
acknowledgement message and requests the data
again.
Four functions of reliable data transfer are:-
Receive data
Encapsulate data prior to sending
Unencapsulate data upon receipt
Send data
12. TCP Flow control
Flow control deals with the amount of data sent to the receiver side without
receiving any acknowledgment. It makes sure that the receiver will not be
overwhelmed with data. It's a kind of speed synchronization process between
the sender and the receiver.
13. Congestion Control
A state occurring in network layer when the message traffic is so heavy that
it slows down network response time.
Imagine a bucket with a small hole in the bottom . No matter at what rate
water enters the bucket, the outflow is at constant rate . When the bucket is
full with water additional water entering spills over the sides and is lost.
Similarly, each network interface contains a leaky bucket and the
following steps are involved in leaky bucket algorithm:
1. When host wants to send packet, packet is thrown into the bucket.
2. The bucket leaks at a constant rate, meaning the network interface
transmits packets at a constant rate.
3. Bursty traffic is converted to a uniform traffic by the leaky bucket.
4. In practice the bucket is a finite queue that outputs at a finite rate.