TCP Cram Sheet
TCP is a protocol, not a software -Comer Vol 1, page 178.
-
Sequence Numbers.
Each byte has a sequence number, beginning
with a randomly chosen Initial Sequence Number. For simplicity,
we often assume the ISN is 0.
-
Acknowledgement. Each side sends acknowledgements, known
as ACK's, in response to data recieved.
The ACK contains the ISN of the next byte it expects to receive.
-
Segments. Since IP is packetized, TCP sends its stream of bytes in
packets which are called Segments.
-
Sliding Window. The sender can send multiple segments, up to the byte with
sequence number W plus the last Sequence Number acknowledged, where
W is the window size. As new acknowledgements come in
all bytes up to by not including the ISN of the
ACK have been confirmed received, so the window slides to allow
more segments to be sent.
-
Window Advertisements. The window is announced by the receiver
in the header of each TCP packet, along with the ACK.
Every packet has an ACK number and a Window.
-
Flow control. Sender cannot send beyond window.
If the window size is zero, the sender must wait.
an unsolicited ACK might follow eventually with a non-zero window to
reopen the window.
-
Piggy-back Ack: each TCP header contains, as well as Flags, an
ACK and a Sequence Number. Packets can simultaneously acknowledge
data sent towards the software with the ACK field and send
data using the sequence number field. In fact, both these
fields must always be valid.
-
Reliability. Unacknowledged bytes will be resent when sender's
ACK timer expires. Although only missing segments need be resent,
in the case of multiple outstanding segments, sender knows only
the lowest Sequence Numbered segment which must be resent.
Other segment may be OK, but until the ACK comes in, sender can't be sure.
-
RTT. The timer for the ACK is sent by time Round Trip Time
of a packet, which is estimated dynamically.
-
Karn's Algorithm.
The RTT is estimated by measuring only packets which have an unambiguous
round trip time, that is, not for retransimitted packets. In addition,
the timeout value, which is a multiple of the RTT, is grown
geometrically (backoff strategy) for which retransmitted packet.
A successful packet resets the backoff.
-
Variance. The timeout to RTT ratio is proportional variance.
-
Multiplicative Decrease. Sender congestion avoidance technique.
Inside the window, keep a congestion window, which halves for each
lost packet.
-
Slow-Start. Sender congestion avoidance technique.
Open the congestion window by adding one segment (MTU) for each
successful packet. Also do this for a new connection, starting
with a congestion window of 1.
-
Silly Window Syndrome. In a filled window, sender sends one addtional
byte for each byte receiver consumes. Small packets waste bandwidth, and
there is no down side to waiting.
-
Receive Side Silly Window Avoidance.
Do not open window unless you can advertise substantial space.
Delay Acknowledgements until you can open the window substantially,
if possible to wait this long.
-
Nagle Algorithm. Send Side Silly Window Avoidance.
To clump data, a self-clocking algorithm consisting of:
if awaiting an acknowledgement, clump data until either the send buffer
full or acknowledgement arrives.
Last Modified:
Fri Mar 10 12:23:58 EST 2006