
The TCP Service Model
| Property | 
Behavior | 
| Stream of bytes | 
Reliable byte delivery service | 
| Reliable delivery | 
1. Acknowledgements indicate correct delivery | 
- Checksums detect corrupted data
 
- Sequence numbers detect missing data
 
- Flow-control prevents overrunning receiver |
| In-sequence | Data delivered to application in sequence transmitted |
| Congestion Control | Controls network congestion |
 

Connection
When two applications use TCP, they establish a two-way communication channel between the TCP peers at both ends.
We call the two way communication a “connection”. At both ends of the connection, TCP keeps a state machine to keep track of how the connection is doing.
3-way Handshake

The TCP connection is established using a 3-way handshake.
- 1. SYN
 
- 2. SYN + ACK
 
- 3. ACK
 
<aside>
📖 More details
- Active opener sends first packet
 
- Passive opener responds
- SYN with sequence number
 
- CKs active opener’s SYN packet
 
 
- Active opener responds
- ACKs passive openers SYN packet
 
 
- Also support “simultaneous open”
- Two SYNs pass each other
 
- Each side ACKs the other
</aside>
 
 
Stream of Byte
