TCP - Part-1 - Introduction
TCP - Part-1 - Introduction
(TCP)
Frame IP TCP
header
header Application-layer data
header
TCP payload
IP payload
Data-link layer payload
Stream of bytes
Segment N Segment 1
H H
acknowledgment number
11
Control field
TCP is connection-oriented.
Passive
Active open
open seq: 8000
UAPRS F
SYN
seq: 15000
Connection ack: 8001
opened nd: 5000
U A P R S F rw
SYN + ACK
seq: 8000
ack: 15001
UAPRS F
rwnd: 10000
ACK
seq: 8001
Send
request ack: 15001
UAPRS F
Data Receive
bytes: 8001-9
000
Connection Termination
22
Receive window in TCP
Messages 1
are pushed 5 Flow control 3 Messages
are pulled
feedback
2
Segements are pushed
4
Flow control feedback
Figure shows
•unidirectional data transfer between a sender and a receiver;
•bidirectional data transfer can be deduced from unidirectional one
The new advertisement, however, defines the new value of rwnd as 4, in which
210 + 4 < 206 + 12.
(byte 214 which has been already sent is outside the window)
TCP/IP Protocol Suite 27
When the send window shrinks, it may creates a problem:
New ack number + new rwnd > = Last ack number + Last rwnd
In other words, the receiver should wait until more bytes are consumed
by its process.
TCP/IP Protocol Suite 28
Silly Window Syndrome
Sending data in very small segments
Prevention
Wait and collect data to send in a larger block
Observation
1. If application program faster than network, segments are larger
2. If application program slower than network, segments are smaller
Silly Window Syndrome
Clark’s Approach
Sending an ACK as soon as data arrives but announcing a window
size of zero until there is enough space to accommodate a segment
of max. size or until half of the buffer is empty
Advantage
The delayed acknowledgement prevents the sending TCP from sliding its
window.
It also reduces traffic.
Disadvantage:
it may force the sender to retransmit the unacknowledged segments
TCP balances the advantage & disadvantage and defines that the
acknowledgement should not be delayed by more than 500ms