Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 18

Welcome to

Unit V: Transport Layer


TCP and UDP
Online Lecture
Why TCP and UDP?
Transport Layer
• The transport Layer is responsible for process-
to-process (client-to-server paradigm) delivery
of a packet from one to another.

• The real communication takes place through


this layer.
Transport Layer Services
Transport Layer Services
TCP: Transmission Control Protocol
• TCP is a “connection-oriented” service.
• In connection oriented service, a connection
first establish between the sender and
receiver, before data transmission.
• After data are transferred, the connection is
released/disconnected.
• TCP uses “Flow and Error Control”
Mechanisms and it is “reliable” protocol.
TCP: Transmission Control Protocol
Stream Delivery Service:
• TCP creates an connection oriented environment in which two
processes to be connected by an “imaginary tube” that carries their
data through internet.

• The “Sending process” produces the data bytes and “receiving


process” consumes them.
TCP: Transmission Control Protocol
Stream Delivery Service:
• The “Sending and receiving process” requires “BUFFERS” for
reading and writing the data at same speed.
• So there are two buffers, the sending buffer and receiving buffer
and these are implemented in a circular array.
TCP: Transmission Control Protocol
• The TCP offers a “Full-duplex Service”, in
which data flow in both directions at the same
time.
• For example, if two process A and B wants to
send and receive the data between them, the
following procedure occurs:
1. The two TCPs establish a connection between
them.
2. Data are exchanged in both directions.
3. The connection is terminated.
TCP Segment Format
TCP Segment Format
• Source Port Address:
This is a 16-bit field that defines the port
number of the sending segment.
• Destination Port Address:
This is a 16-bit field that defines the port
number of the receiving segment.
• Sequence Number:
This is a 32-bit field that defines the number
assigned to the data segment to ensure the
connectivity.
TCP Segment Format
• Acknowledgement Number:
This is a 32-bit field that defines the number
that the receiver is expecting to receive from the
sender.
• Header Length (HLEN):
This is a 4-bit field that defines the length of the
header can be between 20 and 60 bytes.
Therefore the value of this field can be between
5 (5*4=20) and 15(15*4=60).
TCP Segment Format
• Reserved:
This a 6-bit field reserved for future purpose.
• Control bits (or) Flags:
TCP Segment Format
• Window Size:
This is 16-bit field that defines the size of the
window.
• Checksum:
This is 16-bit field that contains the checksum and
it is mandatory for TCP to ensure the reliability.
• Urgent Pointer:
This is a 16-bit field which is valid only if the
‘urgent flag’ is set. It is used when the segment
contains urgent data.
TCP Segment Format
• TCP transmits data in full duplex mode and the
connection establishment in TCP is called as
“Three-way Handshaking”.
UDP: User Datagram Protocol
• UDP is a “connection-less” and “unreliable
transport” protocol.
• So sending a small message by using UDP
takes much less interaction between the
sender and receiver than using TCP.
• It performs very limited error checking.
UDP Segment Format
UDP Segment Format
• Source Port Address:
This is a 16-bit field that defines the port number of the
sending segment.
• Destination Port Address:
This is a 16-bit field that defines the port number of the
receiving segment.
• Length:
This is a 16-bit field that defines the length of the
datagram.
• Checksum:
• This filed is used to detect the errors over the entire
user datagram.

You might also like