Beruflich Dokumente
Kultur Dokumente
16
31
Destination Port
UDP Length
UDP Checksum
Multiplexing
Source Port
Checksum
Validate header
Optional in IPv4
Mandatory in IPv6
16
31
Source IP Address
Destination IP Address
0
17 (UDP)
UDP Length
TCP
TCP
Connection oriented
Full duplex
Data flows in both directions simultaneously
Point-to-point connection
Delayed
Reordered
Late
3-way handshake
3. Teardown
4 step exchange
16
31
Source Port
Destination Port
Sequence Number
ACK Sequence Number
Header Length
0
Flags
Advertised Window
TCP Checksum
Urgent Pointer
Options
6 1-bit flags
Meta header
0
16
31
Source IP Address
Destination IP Address
0
16 (TCP)
URG:
ACK:
PSH:
RST:
SYN:
FIN:
10
TCP Options
Negotiate maximum segment size (MSS)
16-bit checksum
Uses IP checksum algorithm
Computed on header, data and pseudo header
Packet timestamp
Allows RTT calculation for retransmitted packets
Extends sequence number space for identification of stray packets
If URG = 1
Index of last byte of urgent data in segment
Allows larger windows: 64KB too small for routes with large
bandwidth-delay products
11
12
Application
process
Write
bytes
Application
process
Read
bytes
TCP
TCP
Send buffer
Recv buffer
TCP Segment
TCP Segment
TCP Segment
13
14
Host A
User
types
C
ACKs:
SN of next byte
expected from other
side
cumulative ACK
GBN: TCP spec doesnt say
what to do with premature
packets - up to
implementation
host ACKs
receipt of
C, echoes
back C
host ACKs
receipt
of echoed
C
time
15
Event
loss
time
Host A
Host B
Host B
Round-trip time (RTT)
Seq=100 timeout
Seq=92 timeout
timeout
Host A
Host A
Estimated RTT
Data1
Data2
ACK
ACK
Host B
premature timeout,
cumulative ACKs
17
18
(Jacobson/Karels alg.)
2.
2. RTO = 2 EstimatedRTT
3.
4.
Host B
Host A
Retransmission
Wrong RTT
Sample
Host B
Retransmission
Wrong RTT
Sample
Advertised window
21
22
Sending side
Advertised window
24
Solution
Solution
Sender periodically sends 1-byte segment, ignoring advertised window
of 0
Eventually window opens
Sender learns of opening from next ACK of 1-byte segment
25
26
Solution
27
28
Speed
T1
1.5 Mbps
6.4 hours
Ethernet
10 Mbps
57 minutes
T3
45 Mbps
13 minutes
FDDI
100 Mbps
6 minutes
STS-3
155 Mbps
4 minutes
STS-12
622 Mbps
55 seconds
STS-24
1.2 Gbps
28 seconds
Client
Server
listen
Synchronize (SYN)
Acknowledge (ACK):
cumulative!
Passive Open
Server listens for connection
from client
Active Open
30
Client
Server
Active Close
Sends no more data
Passive close
Accepts no more data
31
CLOSED
Disconnected
LISTEN
SYN_RCVD
SYN_SENT
ESTABLISHED
CLOSE_WAIT
LAST_ACK
FIN_WAIT_1
FIN_WAIT_2
CLOSING
TIME_WAIT
Close
SYN/SYN + ACK
SYN_RCVD
Close/FIN
Close/FIN
LISTEN
SYN/SYN + ACK
ESTABLISHED
ACK
FIN +
ACK/ACK
SYN + ACK/ACK
CLOSE_WAIT
CLOSING
FIN_WAIT_2
Close/FIN
LAST_ACK
ACK
TIME_WAIT
FIN/ACK
SYN_SENT
FIN/ACK
FIN/ACK
FIN_WAIT_1
State transitions
Describe the path taken by a server under normal conditions
Describe the path taken by a client under normal conditions
Describe the path taken assuming the client closes the
connection first
TIME_WAIT state
What purpose does this state serve
Prove that at least one side of a connection enters this state
Explain how both sides might enter this state
Close
Send/SYN
ACK
Questions
Active
open/SYN
CLOSED
ACK
Timeout
CLOSED
33
SYN/SYN + ACK
SYN_RCVD
Close/FIN
Close/FIN
LISTEN
ACK
FIN +
ACK/ACK
FIN/ACK
SYN_RCVD
SYN + ACK/ACK
Close
Close/FIN
Close/FIN
CLOSE_WAIT
ACK
LAST_ACK
TIME_WAIT
ACK
Timeout
FIN +
ACK/ACK
FIN/ACK
35
SYN_SENT
SYN + ACK/ACK
ESTABLISHED
FIN/ACK
CLOSE_WAIT
CLOSING
FIN_WAIT_2
CLOSED
SYN/SYN + ACK
FIN/ACK
FIN_WAIT_1
Close/FIN
ACK
Close
LISTEN
Send/SYN
ACK
FIN/ACK
CLOSING
FIN_WAIT_2
SYN_SENT
ESTABLISHED
FIN/ACK
FIN_WAIT_1
Passive open
SYN/SYN + ACK
SYN/SYN + ACK
Active
open/SYN
CLOSED
Close
Send/SYN
ACK
Active
open/SYN
CLOSED
Passive open
34
Close/FIN
LAST_ACK
ACK
TIME_WAIT
ACK
Timeout
CLOSED
36
Congestion
H1
Congestion
Control &
Avoidance
A1(t)
10Mb/s
R1
H2
D(t)
1.5Mb/s
H3
A2(t)
100Mb/s
A1(t)
A1(t)+A2(t)
A2(t)
Cumulative
bytes
A2(t)
D(t)
X(t)
A1(t)
X(t)
D(t)
37
38
39
40
Slow Start
Destination
Source
Slow Start
Congestion Avoidance
41
42
43
44
Host Solutions
Congestion is good?
45
Congestion Avoidance
46
optimal load
Timeout: decrease to 1!
control
power
avoidance
idealized
power curve
load
47
48
rate
Arrivals &
departures
Source
Destination
Queue size
Algorithm
50
Why AIMD?
overutilized &
unfair to 1
overutilized &
unfair to 2
TCP connection 1
TCP
connection 2
desired
region
bottleneck
router
capacity R
underutilized &
unfair to 2
Conn 1 throughput
51
Model assumptions
Sessions know if link is
overused (losses)
Sessions dont know
relative rates
Simplification:
Sessions respond
simultaneously, and in
the same direction (both
increase or both
decrease)
AIMD Convergence
Additive Increase up at 45 angle
full utilization
line
Conn 1 throughput
Conn 1 throughput
53
54
KB
On timeout:
ssthresh := cwnd/2
70
60
50
40
30
20
10
1.0
2.0
3.0
4.0
5.0
6.0
7.0
8.0
9.0
10.0
Time (seconds)
55
56
Receiver
Packet 1
Packet 2
Packet 3
ACK 1
Packet 4
ACK 2
Packet 5
ACK 2
Packet 6
ACK 2
ACK 2
TIMEOUT!
Retransmit
packet 3
ACK 6
58
Congestion Window
60
timeouts
threshold
congestion
window
50
fast retransmission
40
30
20
additive increase
W/2
10
slow start period
0
0
10
20
30
40
50
60
Time
59
Congestion Avoidance
TCPs strategy: increase load until congestion occurs, then
back off
Alternative Strategy
W
Two possibilities
Some help from network:
W/2
DECbit, RED
Host-centric
TCP Vegas
62