Transport Protocols
Transport Protocols
• The Transport Layer provides logical communication between application processes running
on different hosts.
•
• Transport protocols run in the end systems (end-to-end)
• • The sending side breaks application messages into segments and passes them down to
the Network layer
• • The receiving side reassembles the segments into messages and passes them up to the
Application layer
• Transport Layer Protocols
• Two Transport Protocols are available for Applications to use on the Internet:
1. UDP
2. TCP
•
• UDP (User Datagram Protocol)
• Provides: Unreliable, unordered delivery of segments.
•
• TCP (Transmission Control Protocol)
• Provides: Reliable, in-order delivery of segments.
•
• TCP includes:
• Connection set-up (3-way handshake)
• Flow Control
• Congestion Control
•
• NOTE: Neither protocol provides:
• Delay guarantees
• Bandwidth guarantees
• When an Application sends a message down the protocol stack, it selects
whether TCP or UDP should be used for the transmission:
Layer 3 - Network IP
• IP provides host-to-host
communication. TCP provides
process-to-process communication
using the client server paradigm as
shown in Figure 10, suppose out of
several application programs
running on the host, TCP delivers the
data packet to the destined
application program.
Process to Process Communication
• Applications running on different hosts
communicate with TCP with the help of concepts
called ports. A port is a unique 16-bit number
allocated to an application program. It is used when
an application wants to open a TCP connection with
another application on a remote computer. To
understand how, let us take an analogy. A wants to
call B staying in a hotel X, room no.Y. Now A dials the
phone number of the hotel, after getting a response
from the operator, A must tell the room number of B
to be able to connect to B.This information is used to
redirect the call to B.
Process to Process Communication
• Applications running on different hosts
communicate with TCP with the help of concepts
called ports. A port is a unique 16-bit number
allocated to an application program. It is used when
an application wants to open a TCP connection with
another application on a remote computer. To
understand how, let us take an analogy. A wants to
call B staying in a hotel X, room no.Y. Now A dials the
phone number of the hotel, after getting a response
from the operator, A must tell the room number of B
to be able to connect to B.This information is used to
redirect the call to B.
TCP Connections
• We have said again and again that TCP is connection oriented. You may
wonder how TCP connections orients as it uses the services of IP, a
connectionless service. It is because TCP connection is virtual and not
physical. It uses the services of IP for packet delivery but controls the
connection itself. It takes care of reordering, retransmission, duplication, of
which IP is unaware.
• TCP uses a technique called three-way handshaking. It means that three
messages are exchanged between the sender and the receiver to establish
the connection.
• Synchronization Sequence Number (SYN)
- The client sends the SYN to the server
two ends.
• Acknowledgment (ACK) to the server
Header
• A TCP segment's header field can be anything from 20 to 60 bytes long.
Here 40 bytes are used for the options field, which is located at the end of
the TCP header. A header is 20 bytes if there are no options field; otherwise,
it can be up to 60 bytes.
• Header Fields
• Source port- It is a 16-bit field that holds the port address of the application
sending the data.
• Destination Port- It is a 16-bit field that holds the port address of the
application receiving the data.
• Sequence Number- It is used to keep track of the bytes sent. Each byte in a
TCP stream is uniquely identified by the TCP sequence number, which is a
four-byte number.
• Acknowledgment number- It is a 32-bit field that contains the
acknowledgment number or the byte number that the receiver expects to
receive next. It works as an acknowledgment for the previous data received
successfully.
• Header Length (HLEN)- The header length is a 4-bit field that specifies the
length of the TCP header. It helps in knowing from where the actual data
begins.
• Flags- There are six control flags or bits:
• URG: It indicates an urgent pointer. If URG is set, then the data is processed urgently.
• ACK: It represents the acknowledgment field in a segment. If the ACK is set to 0, the
data packet does not contain an acknowledgment.
• RST: It Resets the connection. If RST is set, then it requests to restart a connection.
• PSH: If this field is set, the receiving device is requested to push the data directly to the
receiving application without buffering it.
• SYN: It initiates and establishes a connection between the hosts. If SYN is set, the device
wants to establish a secure connection; else, not.
• FIN: It is used to terminate a connection. If FIN is 1, the device wants to terminate the
connection; else, not.
• Checksum- A checksum is a sequence of numbers and letters used to detect
errors in data. It is a 16-bit field that is optional in UDP but mandatory in
TCP/IP.
• Window size- It is a 16-bit field. This field specifies the size of data that the
receiver can accept.
• Urgent pointer- This field (valid only If the URG flag is set to 1) is used to
indicate urgently needed data and must be received as soon as possible. It
specifies a value that will be appended to the sequence number to get the
last urgent byte's sequence number.
https://youtu.be/uwoD5YsGACg?si=1gWDkhvmEwYms3X6