Module IV
Module IV
THE TRANSPORT
LAYER
Contents
1. Step 1 (SYN): In the first step, the client wants to establish a connection with a server, so it sends
a segment with SYN(Synchronize Sequence Number) which informs the server that the client is
likely to start communication and with what sequence number it starts segments with
2. Step 2 (SYN + ACK): Server responds to the client request with SYN-ACK signal bits set.
ACK : response of the segment it received , SYN: what sequence number it is likely to start the
segments with
3. Step 3 (ACK): In the final part client acknowledges the response of the server and they both
establish a reliable connection with which they will start the actual data transfer
4. ELEMENTS OF TRANSPORT PROTOCOLS
2. Complexity of Connection Establishment:
Three-way handshake: Tomlinson for reliable connection
establishment in presence of delayed duplicate control segments.
1. The typical setup procedure involves the initiating host sending a
CONNECTION REQUEST segment containing a seq no (x) to the receiving host.
2. The receiving host responds with an ACK segment seq no (x) and announcing
its own initial sequence number (y).
3. Finally, the initiating host acknowledges the receiving host's choice of an initial
sequence number in the first data segment it sends.
4. ELEMENTS OF TRANSPORT PROTOCOLS
Connection Release:
Two styles:
Asymmetric release can
lead to abrupt termination
and data loss;
symmetric release enables
independent release of each
direction, avoiding data
loss.
1. Source Port: 16-bit , representing the sender's port on the local host. Together
with the sender's IP address, it forms a unique endpoint for the connection.
2. Destination Port: 16-bit , representing the receiver's port on the remote host.
Together with the receiver's IP address, it forms the destination endpoint for
the connection.
3. Sequence Number: This 32-bit field indicates the seq. number of the first
data byte in the segment. It is used to maintain the correct order of data
transmission and reception.
4. Ack Number: 32-bit field, it indicates the next sequence number that the
sender of the segment expects to receive from the receiver. This field is used
for acknowledging received data and facilitating flow control.
5. Data Offset: This 4-bit field specifies the size of the TCP header in 32-bit
words. Since the header is fixed-format, this field is used to determine where
the data begins in the segment.
6. Reserved: This 6-bit field is reserved for future use and must be set to zero.
8. Window Size: 16-bit-specifies the size of the receive window, which is the
amount of data the sender can transmit before receiving further
acknowledgment from the receiver.
9. Checksum: This 16-bit field is used for error checking of the TCP header
and data.
10. Urgent Pointer: If the URG flag is set, this 16-bit field indicates the offset
from the sequence number indicating urgent data in the segment.
11. Options: Additional header options, such as timestamps, maximum segment
size (MSS), window scale factor,
12. Data: TCP segments can carry up to 65,495 data bytes, calculated by
subtracting the sizes of the IP header (20 bytes) and the TCP header (20
bytes) from the maximum payload size allowed by IP (65,535 bytes).
7. Control Bits: These 8 flags, each occupying 1 bit, control various aspects of the
TCP connection:
1. ECE: Explicit Congestion Notification is used, with ECE
indicating congestion to the TCP sender
2. CWR :CWR signaling the TCP sender to reduce congestion
3. URG: Indicates urgent data in the segment.
4. ACK: Indicates that the Acknowledgment Number field is valid.
5. PSH: Indicates that the data should be pushed to the receiving
application.
6. RST: Indicates a reset request to terminate the connection abruptly
due to various reasons such as host crashes or invalid segments.
7. SYN: Synchronizes sequence numbers to initiate a connection.
SYN = 1 indicating a connection request and SYN = 1 and ACK =
1 indicating a connection acceptance, distinguishing between
connection requests and accepted connections.
8. FIN: Indicates the end of data transmission.
TCP Connection Establishment
•The connections in TCP are established using the three-way
handshake.
Server Side:
The server passively waits for an incoming connection by
executing the LISTEN and ACCEPT primitives in that order.
It specifies either a specific source or waits for connections from
any source.
Client Side:
The client executes a CONNECT primitive, specifying the
destination IP address and port, the maximum TCP segment size it
accepts, and optionally user data.
The CONNECT primitive sends a TCP segment with the SYN bit
on and ACK bit off, waiting for a response.
TCP Connection Establishment
Connection Establishment Process:
1. Upon receiving the SYN segment at the destination, the
TCP entity checks if there's a process listening on the
specified port.
2. If no process is listening, the destination sends a reply
with the RST bit on to reject the connection.
3. If a process is listening, it receives the incoming TCP
segment and can accept or reject the connection.
4. If accepted, an ack segment is sent back to the client.
TCP Connection Release:
1. TCP connections, although full duplex, are best
understood as a pair of simplex connections.
2. To release a connection, either party sends a TCP
segment with the FIN bit set, indicating no more data to
transmit.
3. Upon acknowledgment of the FIN, that direction is shut
down for new data, but data may continue flowing in the
other direction.
4. Connection release requires four TCP segments in total
(one FIN and one ACK for each direction), but it's
possible for the first ACK and second FIN to be in the
same segment, reducing the count to three.
9. The Internet Transport Protocols: TCP