Reliable links
TCP Overview
- Transport-layer protocol built on IP
- Provides reliable, ordered byte stream
- Prevents gaps, duplication, corruption
- Implements stability patterns
Reliability Mechanisms
- Data stream split into numbered segments
- Requires acknowledgment for each segment
- Uses timers for retransmission
- Checksums verify data integrity
Connection States
- Opening (connection creation)
- Established (data transfer)
- Closing (connection termination)
Three-Way Handshake
- Requires full round-trip before data transfer
- Uses sequence numbers for ordering
Flow Control
- Prevents sender overwhelming receiver
- Uses receive buffer for incoming data
- Receiver communicates buffer size in ACKs
- Similar to connection-level rate-limiting
Congestion Control
- sender maintains a so-called congestion window which represents the total number of outstanding segments that can be sent without an acknowledgment from the other side
- Prevents network flooding
- Uses congestion window for in-flight data
- Window size grows exponentially initially
- Reduces on packet loss (segment is lost), this mechanism is called congestion avoidance
- Bandwidth = Window Size / RTT
UDP Alternative
- Connectionless, unreliable protocol
- No guaranteed delivery or ordering
- No flow/congestion control
- Useful for real-time applications (e.g. games)
- Better for cases where speed > reliability
Key Performance Factors:
- Round trip time (RTT) affects bandwidth utilization
- Server proximity to clients improves performance
- Connection reuse reduces cold-start penalty
- Lower latency = better network utilization