Some of the overall features of TCP include:
- Point-to-point
- Single sender + single receiver
- Reliable, in-order byte stream
- No message “boundaries”
- Bytes are simlply written on socket - no max size
- Full duplex data
- Bi-direction data flow in the same connection
- Maintain maximum segment size (MSS)
- Cummulative ACKs (similar to go-back N)
- TCP is optimized for receivers who will buffer out-of-order packets
- Pipelining
- Sender can send N bytes in a window - this is controlled via flow control + congestion control
- e.g. with separate threads for flow control/congestion control, take min from threads
- Ensures that sender does not send too many bytes to overwhelm receiver
- Connection-oriented
- Handshake (exchange oc control message) initializes sender/receiver state before data exchange
- Flow control
- Sender will not overwhelm receiver
TCP Segment Structure
- Sequence number
- Designates order number of first byte in payload
- ACK number
- Can be sent in separate control packet or piggybacked on current packet
- TCP performs cummulative ACK
- Header length
- Can be 20B or more (options available)
- Follow header
- Contains control messages, etc.
- RST, SYN, FIN
- Connection management flags (e.g. finish connection)
- Checksum

TCP Sequence Numbers/ACK
Sequence number is byte stream “number” of first byte in segment data.