0% found this document useful (0 votes)
3 views

Transport Protocols

The Transport Layer facilitates logical communication between application processes on different hosts using two main protocols: TCP and UDP. TCP provides reliable, ordered delivery with features like connection setup and flow control, while UDP offers unreliable, unordered delivery. Both protocols operate at the transport layer, with TCP ensuring process-to-process communication through the use of ports and a three-way handshake for connection establishment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Transport Protocols

The Transport Layer facilitates logical communication between application processes on different hosts using two main protocols: TCP and UDP. TCP provides reliable, ordered delivery with features like connection setup and flow control, while UDP offers unreliable, unordered delivery. Both protocols operate at the transport layer, with TCP ensuring process-to-process communication through the use of ports and a three-way handshake for connection establishment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

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 5 - Application HTTP, FTP, TELNET, etc.

Layer 4 - Transport TCP UDP

Layer 3 - Network IP

Layer 2 - Link Ethernet, WiFi, PPP, etc.

Layer 1 - Physical Guided or Unguided media


• TCP (Transmission Control Protocol)

• TCP characteristics:
• point-to-point connections
➢ one sender, one receiver
• full duplex data:
➢ bi-directional data flow in same connection
• reliable, in-order byte steam transmission
➢ with no “message boundaries” between bytes
• pipelined transmission
➢ multiple segments are sent at the same time
➢ Maximum segments sent simultaneously = TCP congestion/flow control window size
➢ send & receive buffers at sender and receiver
• connection-oriented:
➢ handshaking occurs between the sender, receiver before data exchange
• Uses flow control:
➢ The sender will not overwhelm receiver’s buffer
TCP
• The communication between two computers needs to be “good” and
reliable, to guarantee that the data is received correctly.
Process to Process Communication

• 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

•When the client wants to connect to the


server, then it sends the message to the
server by setting the SYN flag as 1.

•The message carries some additional


information like the sequence number (32-bit
random number).

•The ACK is set to 0. The maximum segment


size and the window size are also set. For
example, if the window size is 1000 bits and
the maximum segment size is 100 bits, then
a maximum of 10 data segments can be
transmitted in the connection by dividing
(1000/100=10).
• The server waits passively to accept any

active connection request. The client

always initiates the connection request.

The client sends the SYN segment in which

only the SYN flag is set. This segment is

used for the synchronization of sequence

numbers. The client chooses a random

number and sends it as the first sequence

number. It does not carry any relevant

data, and consumes one sequence number.


• Synchronization and Acknowledgement
(SYN-ACK) to the client
•The server acknowledges the client request by
setting the ACK flag to 1.
•The ACK indicates the response of the segment it
received and SYN indicates with what sequence
number it will start the segments.
•For example, if the client has sent the SYN with
sequence number = 500, then the server will send
the ACK using acknowledgment number = 5001.
•The server will set the SYN flag to '1' and send it
to the client if the server also wants to establish
the connection.
•The sequence number used for SYN will be
different from the client's SYN.
•The server also advertises its window size and
maximum segment size to the client. And, the
connection is established from the client-side to
the server-side.
• The client sends the third segment, an
ACK segment. It is an

acknowledgement for the second

segment. It bears the same sequence

number as the first segment and hence,

does not consume any sequence

number. After this handshake,

communication can start between the

two ends.
• Acknowledgment (ACK) to the server

•The client sends the acknowledgment (ACK) to


the server after receiving the synchronization
(SYN) from the server.
•After getting the (ACK) from the client, the
connection is established between the client and
the server.
•Now the data can be transmitted between the
client and server sides.
• The server sends the SYN ACK
segment, with SYN and ACK bits set by

sending this, server informs the client

about the sequence number it will use

in future and acknowledges the receipt

of first SYN segment. It also consumes

one sequence number.


TCP Features

• Note: A packet in TCP is called segment


segment

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

You might also like