C SC 481.20 Lecture 8: Transmission Control Protocol (TCP)
major resource: Computer Networking (4th Edition), Kurose and Ross, Addison Wesley, 2008

[ previous | schedule | next ]

TCP – Transport Control Protocol

Overview

TCP provides connection-oriented service. TCP provides connection management

TCP Segment Structure

TCP Reliable Transmission

Sequence and ACK numbers are handled thusly: Note this handles full duplex. For further info, see discussion below of flow and congestion control.

Example:

Example:

TCP Connection setup : 3 way handshake

Three-way handshake to establish connection : 3 segments exchanged
  1. client-to-server connection request :
  2. server-to-client response:
  3. client-to-server confirmation:
If server socket not prepared for connection (or client sends wrong socket number), server responds with RST flag instead of SYN flag

SYN Flood: Buffer allocation by server upon receiving SYN request from client (see above) makes server vulnerable to SYN flood denial of service attack: Malicious client sends flood of fake SYN requests, server allocates buffer space before verifying the request via handshake. Solution? SYN cookie: server does not allocate upon SYN request but instead crafts special initial Sequence number in its SYN response (hash based on client IP addr, port, and its own magic number). If ACK response arrives, verify by running ack number (which should be the hashed number plus 1) through the hash. Once server verifies, then allocate buffers.

Double exchange to terminate connection

Think of it as one exchange to cut off one direction of duplex and second exchange to cut off other direction.
(we’ll show client initiating the sequence; could be either party)
  1. A is finished, sends B a segment with FIN bit set.
  2. B sends acknowledgement to A, and deallocates its buffers
A-to-B direction is now closed.
  1. B sends A a segment with FIN bit set
  2. A sends acknowledgement to B, waits awhile, then deallocates its buffers
B-to-A direction is now closed.

TCP Flow Control

TCP Congestion Control

Distinguish flow control from congestion control

We did not cover TCP congestion algorithm below (it is interesting though)

TCP, as a transport layer protocol, has only indirect knowledge of congestion (from ACK behaviors, sender notices that segments are being delayed and dropped)

A given TCP sender contributes to congestion by transmitting a wider send window (called its “congestion window”), and does its part to relieve congestion by narrowing its window (throttle).

A typical scenario for a large transmission follows these phases (see RFC 2581 for details):

  1. initialize variables:
  2. slow start phase :
  3. congestion avoidance phase :
  4. evidence of congestion occurs:

Algorithm described as Additive-Increase, Multiplicative-Decrease (AIMD), which applies only if you ignore the slow start phase.


[ C SC 481 | Peter Sanderson | Math Sciences server  | Math Sciences home page | Otterbein ]

Last updated:
Peter Sanderson (PSanderson@otterbein.edu)