6.2 Elements of Transport Protocols PDF
6.2 Elements of Transport Protocols PDF
Chapter6 TransportLayer
6.2ElementsofTransportProtocols
ElementsofTransportProtocols
Transport protocol similar to data link protocols
Both do error control and flow control
However, significant differences exist
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
Addressing
How host1 process knows TSAP # at host2?
Stable TSAP # listed in wellknown places
Addressing
User does CONNECT request Process server spawns request server
8
ConnectionEstablishment
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
ConnectionEstablishment
Solutions for delayed duplicates
Not reuse transport address (TSAP)
ConnectionEstablishment
New method with packet lifetime bounded
Label segments with seq # not reused in T
12
ConnectionEstablishment
How to deal with losing memory after crash?
Each host has timeofday clock
ConnectionEstablishment
Clock method work within connection
Host dont remember # across connections
Cant know if CONN REQUEST with initial
seq # is a duplicate of a recent connection
To solve this, use threeway handshake
Check with other peer that con req is current
Used in TCP, with 32bit seq #
Clock not used in TCP; attacker can predict
14
ConnectionEstablishment
CR = Connection Request
Normal Procedure
H1 choses initial s# x
H2 replies
ACKs x
announce own s# y
H1replies
ACKs y
with 1st data segment
15
ConnectionEstablishment
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) 16
ConnectionRelease
Easier than establish
However, some pitfalls
Asymmetric release
each con term separately
abrupt; may cause data loss
better protocol needed
17
ConnectionRelease
Symmetric release
Each direction is released independently
18
ConnectionRelease
Twoarmy problem
each blue army < white army, but together are larger
need to sync attack
however, only com channel is the valley (unreliable)
3way handshake? B1 cant know ACK arrived
making 4way handshake doesnt help either
Attack? Attack?
19
ConnectionRelease
Let each side independently decide its done
Easier to solve
H2 responds with DR
20
ConnectionRelease
Error cases, handled by timers, retransmissions
ConnectionRelease
Protocol usually suffices; can fail in theory
after N lost attempts; half open connection
Not allowing give up, can go on forever
To kill half open connections, automatically
disconnect if no received segments in X sec
Must have timer reset after each segment
Send dummy segments to keep con alive
TCP normally does symmetric close, with
each side independently close con w FIN 22
Multiplexing
Transport, network sharing can either be:
Multiplexing: connections share a network address
Inverse multiplexing: addresses share a connection