Elements of Transport Protocols
Elements of Transport Protocols
3
Addressing
Specify which host process to connect to
TSAP: Transport Service Access Point
In TCP, UDP, called ports
Analogy: NSAP. Example: IP address
Client or server app attaches to TSAP
Connections run through NSAP
TSAP to distinguish endpoints sharing NSAP
4
Addressing
5
Addressing
How host1 process knows TSAP # at host2?
Stable TSAP # listed in well-known places
7
Addressing
User does CONNECT request Process server spawns request server
8
Connection Establishment
Sounds easy; surprisingly tricky!
Just send REQUEST, wait for ACCEPTED?
Can lose, delay, corrupt, duplicate packets
Duplicate may transfer bank money again!
Protocols must work correct all cases
Implemented efficiently in common cases
Main problem is delayed duplicates
Cannot prevent; must deal with (reject)
9
Connection Establishment
Solutions for delayed duplicates
Not reuse transport address (TSAP)
12
Connection Establishment
How to deal with losing memory after crash?
Each host has time-of-day clock
Approach:
Don’t reuse sequence numbers within twice the
MSL (Maximum Segment Lifetime) of 2T=240
secs
Three-way handshake for establishing
connection
CN5E by Tanenbaum & Wetherall, © Pearson Education-
Prentice Hall and D. Wetherall, 2011
Connection Establishment
Use a sequence number space large enough that it
will not wrap, even when sending at full rate
Clock (high bits) advances & keeps state over crash
𝑡 = 5361.3
H2 replies
ACKs x
announce own s# y
H1replies
ACKs y
with 1st data segment
21
Connection Establishment
Abnormal situations
Delayed duplicate CR
H2 sends ACK to H1
X
H1 rejects
H2 knows it was tricked
Worst case
DD CR, old ACK floating
H2 gets delayed CR, replies
X
H1 rejects
X
H2 gets old DATA, discards
(z received instead of y) 22
Connection Release
Easier than establish
However, some pitfalls
Asymmetric release
the way telephone works
1 party hangs up, con broken
abrupt; may cause data loss
better protocol needed
23
Connection Release
Symmetric release
Each direction is released independently
24
Connection Release
Two-army problem
each blue army < white army, but together are larger
need to sync attack
however, only com channel is the valley (unreliable)
3-way handshake? B1 can’t know ACK arrived
making 4-way handshake doesn’t help either
Attack? Attack?
25
Connection Release
Let each side independently decide its done
Easier to solve
H2 responds with DR
26
Connection Release
Error cases, handled by timers, retransmissions