Reading: Chapters 14 and 15
IP gives us
Each program reserves a port of communication so that other prograsm can specify which program should receive its messages.
| port | protocol |
|---|---|
| 21 | FTP |
| 25 | SMTP |
| 53 | DOMAIN |
| 80 | HTTP |
| 153 | FishNet |
The server is a program waiting on a computer with a port reserved. A client reserves a port on its own computer and sends messages to the server by sending messages to the server's port-computer combination. Then the server can respond by sending messages to the client's port-computer combination. And they talk.
(Notice there's nothing wrong with a server or client talking to multiple programs using the same port.)

One challenging problem is deciding how long to wait before giving up on acknowledgements.
The sender adapts based on what it has recently seen. Doing this well turns out to be quite complicated.
Let's skip that part.
Our simple acknowledgement protocol is very slow.


+-------------------+
+----|----+----+----+----|----+----+----+----+----+----+
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
+----|----+----+----+----|----+----+----+----+----+----+
+-------------------+
A sliding window of size 4
The window size corresponds to the number of buckets.

byte 0 source port
byte 2 destination port
byte 4 sequence number
(tells which segment is sent)
byte 8 acknowledgement number
(tells which segment has been received)
byte 12 header length
byte 12.5 ignore
byte 14 desired window size
byte 16 ignore
byte 20
: options
:
byte ??
: application message
This part of lecture will be a computer demo following Chapter 15 fairly closely.