TCP-UDP
TCP-UDP
Transport Layer
m bandwidth guarantees
application P3 P1
P1 application P2 P4 application
P2 P1
P1
P3
P1 P4 P5 P6 P2 P1P3
SP: 5775
DP: 80
S-IP: B
D-IP:C
P1 P4 P2 P1P3
SP: 5775
DP: 80
S-IP: B
D-IP:C
Sender: Receiver:
r treat segment contents as r compute checksum of received
sequence of 16-bit integers segment
r checksum: addition (1’s r check if computed checksum
complement sum) of segment equals checksum field value:
contents m NO - error detected
r sender puts checksum value m YES - no error detected. But
into UDP checksum field maybe errors nonetheless?
More later ….
1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
wraparound 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
sum 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0
checksum 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1
Transport Layer 3-0
Chapter 3 outline
r 3.1 Transport-layer r 3.5 Connection-oriented
services transport: TCP
r 3.2 Multiplexing and m segment structure
m reliable data transfer
demultiplexing m flow control
r 3.3 Connectionless m connection management
transport: UDP r 3.6 Principles of congestion
r 3.4 Principles of reliable control
data transfer r 3.7 TCP congestion control
send receive
side side
sender receiver
L 8000bits
d trans = = 9
= 8 microseconds
R 10 bps
m U sender: utilization – fraction of time sender busy sending
U L/R .008
= = = 0.00027
sender 30.008
RTT + L / R m i c r o s ec
m
o n d s link
1KB pkt every 30 msec -> 33kB/sec thruput over 1 Gbps
m network protocol limits use of physical resources!
U L/R .008
sender
= = = 0.00027
RTT + L / R 30.008 m i c r o s ec
onds
Increase utilization
by a factor of 3!
U 3 *L/R .024
sender
= = = 0.0008
RTT + L / R 30.008 microsecon
ds
Transport Layer 3-0
Pipelining Protocols
Go-back-N: big picture: Selective Repeat: big pic
r Sender can have up to N r Sender can have up to N
unacked packets in unacked packets in
pipeline pipeline
r Rcvr only sends r Rcvr acks individual
cumulative acks packets
m Doesn’t ack packet if r Sender maintains timer for
there’s a gap
each unacked packet
r Sender has timer for oldest m When timer expires,
unacked packet retransmit only unack
m If timer expires, retransmit packet
all unacked packets
Seq=92, 8 bytes
data
ti ACK=10
m 0
Seq=100, 20 bytes
e Xdata
o loss
u
t
SendBase ACK=120
= 120
time
Cumulative ACK scenario
r speed-matching service:
matching the send rate to
the receiving app’s drain
rate
r app process may be slow
at reading from buffer
Congestion:
r informally: “too many sources sending too much data too
fast for network to handle”
r different from flow control!
r manifestations:
m lost packets (buffer overflow at routers)
m long delays (queueing in router buffers)
r a top-10 problem!
buffers
r no retransmission
R/3
l l l
R/4
o o o
u u u
t t t
a. b. c.
“costs” of congestion:
r more work (retrans) for given “goodput”
r unneeded retransmissions: link carries multiple copies of pkt
Transport Layer 3-0
Approaches towards congestion control
Two broad approaches towards congestion control:
o
n tim
time
w e
i
Transport Layer 3-0
n
TCP Congestion Control: details
r sender limits transmission: How does sender perceive
LastByteSent-LastByteAcked congestion?
CongWin r loss event = timeout or 3
r Roughly, duplicate acks
rate =
CongWin r TCP sender reduces rate
Bytes/sec
RTT (CongWin) after loss
r CongWin is dynamic, function of event
perceived network congestion three mechanisms:
m AIMD
m slow start
m conservative after timeout
events