Professional Documents
Culture Documents
1._IP_TCPUDP
1._IP_TCPUDP
2 07/11/24
20 bytes ≤ Header Size < = 60 bytes
20 bytes ≤ Total Length < 216 65536 bytes
3 07/11/24
The Transmission Control Protocol
(TCP)
TCP Ports
Interprocess communication via TCP is achieved with the
use of ports.
TCP Segments
The chunk of data that TCP asks IP to deliver is called a
TCP segment.
TCP Header
Transmission Control Protocol
(TCP)
Flag Description
Solution
The following shows the sequence number for each segment:
Segment 1 ==> sequence number: 10,010 (range: 10,010 to 11,009)
Segment 2 ==> sequence number: 11,010 (range: 11,010 to 12,009)
Segment 3 ==> sequence number: 12,010 (range: 12,010 to 13,009)
Segment 4 ==> sequence number: 13,010 (range: 13,010 to 14,009)
Segment 5 ==> sequence number: 14,010 (range: 14,010 to 16,009)
Transmission Control Protocol
(TCP)
SYN
SYN 2
ISN=Y
ISN=YACK=X+1
ACK=X+1
3
ACK=Y+1
ACK=Y+1
Transmission Control Protocol
(TCP)
2
ACK=X+1
ACK=X+1
...
FIN
FIN 3
SN=Y
SN=Y
ACK=Y+1 4
ACK=Y+1
Transmission Control Protocol
(TCP)
HINTS:
TCP is a reliable service.
IP delivers each TCP segment.
IP is not reliable.
Providing Reliability with
Acknowledgments and Retransmissions
Receive ACK
1
Send packet 2
Receive packet
2
Send ACK 2
Receive ACK
2
Packet Loss
(Timeout)
Send packet 1
Receive packet
1
Send ACK 1
Receive ACK
1
ACK Loss
(Timeout)
Send packet 1
Receive packet
1 (Discard)
Send ACK 1
Receive ACK
1
ACK Delayed
Receive ACK
(Discard) 1
A Problem
ACK1
3
ACK2
ACK3
Sliding Windows(Sender)
window
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
Sliding Windows (Sender cont)
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
Ideal Sliding Window Performance
31 07/11/24
TCP Sliding Windows - Flow Control
Each window can vary in size over time
The size of the window can be increased or decreased by the
destination.
Each ACK contains a window advisement
Specifies how many additional data the receiver is willing to
accept
Sender increases or decreases sending window sized based on the
receiver’s advise
Provides end-to-end flow control
TCP Sliding Windows -
Flow Control Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14
1 2 3 4 5 6 7 8 9 10 11 12 13 14
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Error Control
34 07/11/24
Error Control Mechanisms
Checksum (to check for corrupted segment)
Acknowledgment (to confirm receipt of data segment)
Retransmission (when packet lost, corrupted or
delayed)
Out-of-Order Segments (store until missing packet
arrvies)
35 07/11/24
User Datagram protocol