High-level Internet

Reading: Chapters 14 and 15

IP gives us

But our programs want This is a job for TCP (Transport Control Protocol).

Ports

Each program reserves a port of communication so that other prograsm can specify which program should receive its messages.

portprotocol
21FTP
25SMTP
53DOMAIN
80HTTP
153FishNet

Clients and Servers

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.)

Reliable delivery

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.

Sliding window

Our simple acknowledgement protocol is very slow.

Better to have many buckets.
This is done with a sliding window.
     +-------------------+
+----|----+----+----+----|----+----+----+----+----+----+
|  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.

Sliding-window delivery

The TCP header

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

Applications

This part of lecture will be a computer demo following Chapter 15 fairly closely.