I read TCP Technology Introduction, so I’ll take some notes on the interesting parts, although they’re rather miscellaneous. First, the first half. I’ve heard about network-related topics, but I often forget them if I don’t use them.

Chapter 1: Introduction to TCP

  • Transmission efficiency
    • Ethernet frame 1500 bytes, TCP header 60 bytes, IP header 20 bytes
    • Applications can use 1420 bytes
    • Considering Ethernet header 14 bytes and FCS (Frame Check Sequence) 4 bytes, transmission efficiency is $1420/(1500+18) \times 100=93.5%$
  • UDP
    • What UDP actually does is just sending data to the destination and checking the checksum
    • TCP is unicast, but UDP also supports multicast and broadcast in addition to unicast
    • There’s RTP (Real-time Transport Protocol) with added sequence numbers and timestamps, and RUDP (Reliable User Datagram Protocol) with added retransmission functionality
    • QUIC is UDP-based, using HTTP/3 (HTTP-over-QUIC). Connection establishment and TLS establishment are done simultaneously.
  • TCP
    • The sequence number in ACK is the number it wants to receive next. Until the segment arrives, it continues to return the same sequence number.
    • Flow control: Adjusting the amount of transmitted data to prevent receiver buffer overflow. In TCP, the size that can be transmitted at once is called the window. The parameter held by the sender is denoted as swnd (send window). In contrast, the receiver has rwnd (receive window).
  • TCP congestion control
    • Loss-based: Judging congestion from data loss
    • Delay-based: Judging congestion from RTT
  • Protocols for specific purposes
    • RUDP (Reliable User Datagram Protocol): UDP-based with added sequence numbers, ACK, retransmission, and flow control
    • DCCP (Datagram Congestion Control Protocol): For congestion mitigation in UDP

Chapter 2: Evolution of TCP/IP

  • In networks like ARPNET, the network guaranteed reliability, but in TCP/IP, each node assumes that role
  • Nagle algorithm: A method to reduce the number of TCP/IP packets sent. The beginning of congestion control algorithms
  • The inclusion of TCP/IP in Windows 95 (OSR2 and later) was the trigger for its widespread adoption
  • IEEE 802.11 adopts CSMA/CA at the MAC layer

Chapter 3: TCP and Data Transfer

  • MTU is 1500 bytes for Ethernet, 1492 bytes for PPPoE, and 9180 bytes for ATM. However, it can be set arbitrarily recently
  • MSS (Maximum Segment Size): The maximum packet length that TCP segments
  • MTU (1500 bytes) = IP header (20 bytes) + TCP header (20~60 bytes) + application data (MSS or less)
    • MSS is only the TCP payload
    • MTU includes from TCP payload to TCP header and IP header. Does not include Ethernet header
  • ACK (Acknowledgement Number): Acknowledgement response number. The sequence number to be sent next
  • Control flags
    • RST (Reset the connection): Forcibly disconnect the connection. Activated if there’s an abnormality, such as sending to an unused port number
    • CWR (Congestion Window Reduced): Notifies reduction of congestion window. Used with ECN
    • ECE (ECN echo): Notifies when congestion occurs
  • Window control: Adjusting the window size $swnd$ that can be transmitted at once $swnd = min(rwnd, cwnd)$
    • Flow control: The receiver notifies the sender of the transmission amount and adjusts it. The receiver notifies the sender of the receivable buffer amount $rwnd$
    • Congestion control: Adjusting the congestion window $cwnd$
  • Slow start
    • At the start of communication, each time an ACK is received, $cwnd$ is increased by 1 segment $cwnd = cwnd + mss$
    • $cwnd$ grows exponentially
  • Congestion avoidance
    • If slow start is performed, retransmission is likely to occur again
    • Half of $cwnd$ when retransmission occurs $cwnd/2$ is set as a threshold, and when it exceeds that, the update is made gradual $cwnd = cwnd + mss/cwnd$
    • Increases linearly per RTT
  • Fast recovery
    • It’s inefficient to perform slow start → congestion avoidance behavior every time congestion occurs
    • Triggered by duplicate ACKs
    • Adopted in Reco
  • Segment loss
    • When the retransmission timer times out
    • When a certain number of duplicate ACKs arrive