1
Llorenç Cerdà-Alabern
Computer Networks - Xarxes de Computadors Outline Course Syllabus - - PowerPoint PPT Presentation
Grau en enginyeria informtica - Xarxes de Computadors (XC-grau) Computer Networks - Xarxes de Computadors Outline Course Syllabus Unit 1: Introduction Unit 2. IP Networks Unit 3. LANs Unit 4. TCP Unit 5. Network applications 1 Lloren
Llorenç Cerdà-Alabern
Llorenç Cerdà-Alabern
Llorenç Cerdà-Alabern
TCP/UDP header dst port = y1 src port = x1 dst port = x1 src port = y1 Well known port <1024 Ephemeral port (≥ 1024) ... Host B Host A ... ... ... port y1 port x1 TCP/UDP TCP/UDP server client daemon
Llorenç Cerdà-Alabern
Llorenç Cerdà-Alabern
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 +
| S
r c e P
t | D e s t i n a t i
P
t | +
| L e n g t h | C h e c k s u m | +
+
| S
r c e A d d r e s s | +
| D e s t i n a t i
A d d r e s s | +
| Z e r
P r
| U D P l e n g t h | +
UDP datagram header UDP pseudo-header
Llorenç Cerdà-Alabern
Llorenç Cerdà-Alabern
Llorenç Cerdà-Alabern
buffer Rx buffer Tx ack PDUs information PDUs Layer i+1 Write Read Layer i+1 Sender Layer i Receiver Layer i Read Sender Receiver Layer i+1 Layer i protocol ARQ Write Read Sender Receiver Layer i+1 Layer i Write ARQ Protocol Architecture ARQ Protocol Implementation (one way)
Llorenç Cerdà-Alabern
sender receiver vt bps bitrate line D km distance
Llorenç Cerdà-Alabern
Tx buffer tt write write Ik Transmission (Tx) sender receiver Rx buffer read tp Tc processing time t tt Ik Ik+1 processing time Ik Ak+1 Ak ta t read Ik+1
sender receiver tp Tc t tt Ik Ak ta t tp
Llorenç Cerdà-Alabern
RTO t tt Ik t
sender receiver Ik Ak ta Ik+1
Llorenç Cerdà-Alabern
RTO t Ik t
sender receiver Ik Ik or Ik+1? Ak
RTO t Ik t
sender receiver Ik Ak
abnormally large processing time Ak Ik+1 Ik+2 !!
Llorenç Cerdà-Alabern
information bits line idle t tb
headers
Llorenç Cerdà-Alabern
sender receiver tp Tc t tt Ik Ak ta t tp
10 20 30 40 50 60 70 80 90 100 0.5 1 1.5 2 2.5 3 Efficiency, E (%)
1 12a a=t p/t t
Llorenç Cerdà-Alabern
t t Ik Ik+1 Ik+2 Ik+3 Ik Ik+1 Ik+4 Ik+5 Tx buffer sender receiver
Ik+1 Ik+2 Ik+3 Ik+4 Ik+2 Ik+3 Ik+4 Ik+5 Ik+2 Ik+3 Ik+4 Ik+5 Ak+1 Ak+2 Ak+3 Ak+4 Ak+5 Ak
Llorenç Cerdà-Alabern
t t Ik Ik+1 Ik+2 Ik+3 Ik+1 Ik+2 sender receiver
Ak+1 Ak+2 Ak
RTO
Llorenç Cerdà-Alabern
t t Ik Ik+1 Ik+2 Ik+3 Ik+1 Ik+4 sender receiver
Ak+3 Ak+4 Ak
RTO The receiver has to store and order PDUs
Llorenç Cerdà-Alabern
All PDUs ack. Ik+1 Tx window First non ack PDU Last Tx PDU Ik Ik+2 Ik+3 Ik+4 Ik+5
Llorenç Cerdà-Alabern
sender receiver t t
Ak+1 Ak+2 Ak+3 Ak+4 Ak+5 Ak+6 Ik+3 Ik+4 Ik+5 Ik+6 Ik+7 Ik+8 Ik+2 Ik+9
Ak Ik Ik+1 Ak+7 Ak+8 W = 3 sender receiver t
Ak+1 Ak+2 Ak+3 Ak+4 Ak+5 Ik+8
Ak Ik+3 Ik+4 Ik+5 Ik+6 Ik+7 Ik+2 Ik Ik+1 W = 3 t
TC tt
Llorenç Cerdà-Alabern
Llorenç Cerdà-Alabern
Llorenç Cerdà-Alabern
Internet Flow Control: awnd Congestion losses Congestion control: TCP reduce the congestion window (cwnd) when losses are detected. Bottleneck host A Application layer TCP layer Rx buffer read() Tx buffer write() awnd: empty space at Rx buffer host B Application layer TCP layer read() write() awnd: empty space at Rx buffer Rx buffer Tx buffer
Llorenç Cerdà-Alabern
. . . 1 1 : 2 7 : 1 3 . 7 9 8 8 4 9 1 4 7 . 8 3 . 3 2 . 1 4 . f t p > 1 4 7 . 8 3 . 3 5 . 1 8 . 3 2 : P 9 6 4 1 : 1 1 8 9 ( 1 4 4 8 ) a c k 1 w i n 1 1 3 6 ( D F ) 1 1 : 2 7 : 1 3 . 8 1 7 4 1 4 7 . 8 3 . 3 2 . 1 4 . f t p > 1 4 7 . 8 3 . 3 5 . 1 8 . 3 2 : P 1 1 8 9 : 1 2 5 3 7 ( 1 4 4 8 ) a c k 1 w i n 1 1 3 6 ( D F ) 1 1 : 2 7 : 1 3 . 8 1 9 1 1 4 7 . 8 3 . 3 5 . 1 8 . 3 2 > 1 4 7 . 8 3 . 3 2 . 1 4 . f t p : . 1 : 1 ( ) a c k 1 2 5 3 7 w i n 3 1 8 5 6 ( D F ) 1 1 : 2 7 : 1 3 . 8 1 4 5 1 4 7 . 8 3 . 3 2 . 1 4 . f t p > 1 4 7 . 8 3 . 3 5 . 1 8 . 3 2 : P 1 2 5 3 7 : 1 3 9 8 5 ( 1 4 4 8 ) a c k 1 w i n 1 1 3 6 ( D F ) 1 1 : 2 7 : 1 3 . 8 2 7 7 1 1 4 7 . 8 3 . 3 2 . 1 4 . f t p > 1 4 7 . 8 3 . 3 5 . 1 8 . 3 2 : P 1 3 9 8 5 : 1 5 4 3 3 ( 1 4 4 8 ) a c k 1 w i n 1 1 3 6 ( D F ) 1 1 : 2 7 : 1 3 . 8 2 7 8 8 1 4 7 . 8 3 . 3 5 . 1 8 . 3 2 > 1 4 7 . 8 3 . 3 2 . 1 4 . f t p : . 1 : 1 ( ) a c k 1 5 4 3 3 w i n 3 1 8 5 6 ( D F ) . . . t i m e s t a m p s r c I P a d d r / p
t d s t I P a d d r / p
t s e q . n u m : n e x t s e q n u m ( b y t e s ) a w n d T C P fm a g s 1 1 : 2 7 : 1 3 . 7 9 8 8 4 9 1 4 7 . 8 3 . 3 2 . 1 4 . f t p > 1 4 7 . 8 3 . 3 5 . 1 8 . 3 2 : P 9 6 4 1 : 1 1 8 9 ( 1 4 4 8 ) a c k 1 w i n 1 1 3 6 ( D F ) a c k D F fm a g i n I P h e a d e r s e t .
Llorenç Cerdà-Alabern
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 +
| S
r c e P
t | D e s t i n a t i
P
t | +
| S e q u e n c e N u m b e r | +
| A c k n
l e d g m e n t N u m b e r | +
| H e a d e r | | U | A | P | R | S | F | | | l e n g t h | R e s e r v e d | R | C | S | S | Y | I | A d v e r t i s e d w i n d
( a w n d ) | | | | G | K | H | T | N | N | | +
| C h e c k s u m | U r g e n t P
n t e r | +
| O p t i
s | P a d d i n g | +
+
| S
r c e A d d r e s s | +
| D e s t i n a t i
A d d r e s s | +
| Z e r
P r
| T C P l e n g t h | +
TCP segment header TCP pseudo-header
2 b y t e s ≤ 4 b y t e s T C P fm a g s
Llorenç Cerdà-Alabern
Llorenç Cerdà-Alabern
9 : 3 3 : 2 . 5 5 6 7 8 5 I P 1 4 7 . 8 3 . 3 4 . 1 2 5 . 2 4 3 7 4 > 1 4 7 . 8 3 . 1 9 4 . 2 1 . 8 : S 3 6 2 4 6 6 2 6 3 2 : 3 6 2 4 6 6 2 6 3 2 ( ) w i n 5 8 4 < m s s 1 4 6 , s a c k O K , t i m e s t a m p 5 3 1 4 1 9 1 5 5 , n
, w s c a l e 7 > 9 : 3 3 : 2 . 5 5 8 5 4 I P 1 4 7 . 8 3 . 1 9 4 . 2 1 . 8 > 1 4 7 . 8 3 . 3 4 . 1 2 5 . 2 4 3 7 4 : S 2 2 4 3 6 6 9 7 5 : 2 2 4 3 6 6 9 7 5 ( ) a c k 3 6 2 4 6 6 2 6 3 3 w i n 5 7 9 2 < m s s 1 4 6 , s a c k O K , t i m e s t a m p 3 8 7 2 3 4 3 4 4 5 3 1 4 1 9 1 5 5 , n
, w s c a l e 2 > 9 : 3 3 : 2 . 5 5 8 8 1 I P 1 4 7 . 8 3 . 3 4 . 1 2 5 . 2 4 3 7 4 > 1 4 7 . 8 3 . 1 9 4 . 2 1 . 8 : . a c k 1 w i n 4 6 < n
, n
, t i m e s t a m p 5 3 1 4 1 9 1 5 6 3 8 7 2 3 4 3 4 4 > 9 : 3 3 : 2 . 5 5 8 4 3 7 I P 1 4 7 . 8 3 . 3 4 . 1 2 5 . 2 4 3 7 4 > 1 4 7 . 8 3 . 1 9 4 . 2 1 . 8 : P 1 : 6 2 7 ( 6 2 6 ) a c k 1 w i n 4 6 < n
, n
, t i m e s t a m p 5 3 1 4 1 9 1 5 6 3 8 7 2 3 4 3 4 4 > 9 : 3 3 : 2 . 5 5 9 1 4 6 I P 1 4 7 . 8 3 . 1 9 4 . 2 1 . 8 > 1 4 7 . 8 3 . 3 4 . 1 2 5 . 2 4 3 7 4 : . a c k 6 2 7 w i n 1 7 6 1 < n
, n
, t i m e s t a m p 3 8 7 2 3 4 3 4 5 5 3 1 4 1 9 1 5 6 > 9 : 3 3 : 2 . 5 5 9 5 7 I P 1 4 7 . 8 3 . 1 9 4 . 2 1 . 8 > 1 4 7 . 8 3 . 3 4 . 1 2 5 . 2 4 3 7 4 : P 1 : 2 7 1 ( 2 7 ) a c k 6 2 7 w i n 1 7 6 1 < n
, n
, t i m e s t a m p 3 8 7 2 3 4 3 4 5 5 3 1 4 1 9 1 5 6 > 9 : 3 3 : 2 . 5 5 9 5 1 9 I P 1 4 7 . 8 3 . 3 4 . 1 2 5 . 2 4 3 7 4 > 1 4 7 . 8 3 . 1 9 4 . 2 1 . 8 : . a c k 2 7 1 w i n 5 4 < n
, n
, t i m e s t a m p 5 3 1 4 1 9 1 5 6 3 8 7 2 3 4 3 4 5 > 9 : 3 3 : 2 . 5 6 1 5 4 I P 1 4 7 . 8 3 . 1 9 4 . 2 1 . 8 > 1 4 7 . 8 3 . 3 4 . 1 2 5 . 2 4 3 7 4 : . 2 7 1 : 1 7 1 9 ( 1 4 4 8 ) a c k 6 2 7 w i n 1 7 6 1 < n
, n
, t i m e s t a m p 3 8 7 2 3 4 3 4 5 5 3 1 4 1 9 1 5 6 > 9 : 3 3 : 2 . 5 6 1 6 7 I P 1 4 7 . 8 3 . 3 4 . 1 2 5 . 2 4 3 7 4 > 1 4 7 . 8 3 . 1 9 4 . 2 1 . 8 : . a c k 1 7 1 9 w i n 7 7 < n
, n
, t i m e s t a m p 5 3 1 4 1 9 1 5 6 3 8 7 2 3 4 3 4 5 > 9 : 3 3 : 2 . 5 6 2 5 6 I P 1 4 7 . 8 3 . 1 9 4 . 2 1 . 8 > 1 4 7 . 8 3 . 3 4 . 1 2 5 . 2 4 3 7 4 : . 1 7 1 9 : 3 1 6 7 ( 1 4 4 8 ) a c k 6 2 7 w i n 1 7 6 1 < n
, n
, t i m e s t a m p 3 8 7 2 3 4 3 4 5 5 3 1 4 1 9 1 5 6 > 9 : 3 3 : 2 . 5 6 2 6 1 I P 1 4 7 . 8 3 . 3 4 . 1 2 5 . 2 4 3 7 4 > 1 4 7 . 8 3 . 1 9 4 . 2 1 . 8 : . a c k 3 1 6 7 w i n 1 < n
, n
, t i m e s t a m p 5 3 1 4 1 9 1 5 6 3 8 7 2 3 4 3 4 5 > . . . T C P fm a g s S : S Y N P : P U S H . : N
a g ( e x c e p t a c k ) i s s e t
Llorenç Cerdà-Alabern
Llorenç Cerdà-Alabern
... write() ... write() ... write() sender Tx buffer MSS bytes: from S0 to S0 + MSS - 1 S0 S3 S4 S3 S5 S6 S2 S1 S0 t t ... ack=S3+MSS ack=S4+MSS a c k = S 5 + M S S ack=S6+MSS ack=S2+MSS ack=S1+MSS ack=S0+MSS Receiver Sender S1 MSS S2 S5 S4 MSS MSS MSS MSS MSS MSS S6 ... wnd=MSS S3 wnd=2·MSS wnd=4·MSS S7 S1=S0+MSS
Llorenç Cerdà-Alabern
Client Server S0 SYN V0 SYN ack=S0+1 Three way handshaking Client t t ...
c
n e c t ( ) c l
e ( ) r e a d ( ) / w r i t e S Y N
E N T E S T A B L I S H E D F I N
A I T
F I N
A I T
T I M E
A I T C L O S E D
ack=V0+1 S1=S0+1 Si FIN ack=Si+1 Sj FIN ack=Sj+1 Termination
l i s t e n ( ) a c c e p t ( ) c l
e ( ) C L O S E D L A S T
C K C L O S E
A I T E S T A B L I S H E D S Y N
E C V L I S T E N r e a d ( ) / w r i t e
Llorenç Cerdà-Alabern
1 2 : 3 : 3 7 . 6 9 5 4 1 I P 1 4 7 . 8 3 . 3 4 . 1 2 5 . 1 7 7 8 8 > 1 4 7 . 8 3 . 3 2 . 8 2 . 8 : S 3 4 7 3 6 6 1 1 4 6 : 3 4 7 3 6 6 1 1 4 6 ( ) w i n 5 8 4 < m s s 1 4 6 , s a c k O K , t i m e s t a m p 2 9 6 4 7 6 7 5 4 , n
, w s c a l e 7 > 1 2 : 3 : 3 7 . 7 2 1 I P 1 4 7 . 8 3 . 3 2 . 8 2 . 8 > 1 4 7 . 8 3 . 3 4 . 1 2 5 . 1 7 7 8 8 : S 5 4 4 3 7 3 2 1 6 : 5 4 4 3 7 3 2 1 6 ( ) a c k 3 4 7 3 6 6 1 1 4 7 w i n 5 7 9 2 < m s s 1 4 6 , s a c k O K , t i m e s t a m p 1 8 2 4 7 7 6 2 3 2 9 6 4 7 6 7 5 4 , n
, w s c a l e 2 > 1 2 : 3 : 3 7 . 7 3 8 I P 1 4 7 . 8 3 . 3 4 . 1 2 5 . 1 7 7 8 8 > 1 4 7 . 8 3 . 3 2 . 8 2 . 8 : . a c k 1 w i n 4 6 < n
, n
, t i m e s t a m p 2 9 6 4 7 6 7 5 4 1 8 2 4 7 7 6 2 3 > 1 2 : 3 : 3 7 . 7 2 7 6 3 I P 1 4 7 . 8 3 . 3 4 . 1 2 5 . 1 7 7 8 8 > 1 4 7 . 8 3 . 3 2 . 8 2 . 8 : P 1 : 6 2 ( 6 1 ) a c k 1 w i n 4 6 < n
, n
, t i m e s t a m p 2 9 6 4 7 6 7 5 4 1 8 2 4 7 7 6 2 3 > 1 2 : 3 : 3 7 . 7 3 5 4 6 I P 1 4 7 . 8 3 . 3 2 . 8 2 . 8 > 1 4 7 . 8 3 . 3 4 . 1 2 5 . 1 7 7 8 8 : . a c k 6 2 w i n 1 7 4 9 < n
, n
, t i m e s t a m p 1 8 2 4 7 7 6 2 7 2 9 6 4 7 6 7 5 4 > 1 2 : 3 : 3 7 . 7 5 9 3 2 I P 1 4 7 . 8 3 . 3 2 . 8 2 . 8 > 1 4 7 . 8 3 . 3 4 . 1 2 5 . 1 7 7 8 8 : P 1 : 5 2 6 ( 5 2 5 ) a c k 6 2 w i n 1 7 4 9 < n
, n
, t i m e s t a m p 1 8 2 4 7 7 6 2 9 2 9 6 4 7 6 7 5 4 > 1 2 : 3 : 3 7 . 7 5 9 4 8 I P 1 4 7 . 8 3 . 3 4 . 1 2 5 . 1 7 7 8 8 > 1 4 7 . 8 3 . 3 2 . 8 2 . 8 : . a c k 5 2 6 w i n 5 4 < n
, n
, t i m e s t a m p 2 9 6 4 7 6 7 5 5 1 8 2 4 7 7 6 2 9 > 1 2 : 3 : 5 3 . 8 8 7 4 I P 1 4 7 . 8 3 . 3 2 . 8 2 . 8 > 1 4 7 . 8 3 . 3 4 . 1 2 5 . 1 7 7 8 8 : F 5 2 6 : 5 2 6 ( ) a c k 6 2 w i n 1 7 4 9 < n
, n
, t i m e s t a m p 1 8 2 4 7 8 7 4 3 5 2 9 6 4 7 6 7 5 5 > 1 2 : 3 : 5 3 . 9 2 3 5 4 I P 1 4 7 . 8 3 . 3 4 . 1 2 5 . 1 7 7 8 8 > 1 4 7 . 8 3 . 3 2 . 8 2 . 8 : . a c k 5 2 7 w i n 5 4 < n
, n
, t i m e s t a m p 2 9 6 4 8 9 6 6 1 8 2 4 7 8 7 4 3 5 > 1 2 : 3 : 5 6 . 7 2 I P 1 4 7 . 8 3 . 3 4 . 1 2 5 . 1 7 7 8 8 > 1 4 7 . 8 3 . 3 2 . 8 2 . 8 : F 6 2 : 6 2 ( ) a c k 5 2 7 w i n 5 4 < n
, n
, t i m e s t a m p 2 9 6 4 8 1 5 4 1 8 2 4 7 8 7 4 3 5 > 1 2 : 3 : 5 6 . 7 4 8 6 I P 1 4 7 . 8 3 . 3 2 . 8 2 . 8 > 1 4 7 . 8 3 . 3 4 . 1 2 5 . 1 7 7 8 8 : . a c k 6 3 w i n 1 7 4 9 < n
, n
, t i m e s t a m p 1 8 2 4 7 8 9 6 2 5 2 9 6 4 8 1 5 4 >
1 2 : 3 : 3 7 . 6 9 5 4 1 I P 1 4 7 . 8 3 . 3 4 . 1 2 5 . 1 7 7 8 8 > 1 4 7 . 8 3 . 3 2 . 8 2 . 8 : S 3 4 7 3 6 6 1 1 4 6 : 3 4 7 3 6 6 1 1 4 6 ( ) w i n 5 8 4 < m s s 1 4 6 , s a c k O K , t i m e s t a m p 2 9 6 4 7 6 7 5 4 , n
, w s c a l e 7 > t i m e s t a m p s r c I P a d d r / p
t d s t I P a d d r / p
t s e q . n u m : n e x t s e q n u m ( b y t e s ) a w n d w i n d
s c a l e t i m e s t a m p S A C K M S S p a d d i n g T C P fm a g s T W H T e r m i n a t i
Llorenç Cerdà-Alabern
Client Server S0 SYN V0 SYN ack=S0+1 Three way handshaking Client t t ...
c
n e c t ( ) c l
e ( ) r e a d ( ) / w r i t e S Y N
E N T E S T A B L I S H E D F I N
A I T
F I N
A I T
T I M E
A I T C L O S E D
ack=V0+1 S1=S0+1 Si FIN ack=Si+1 Sj FIN ack=Sj+1 Termination
l i s t e n ( ) a c c e p t ( ) c l
e ( ) C L O S E D L A S T
C K C L O S E
A I T E S T A B L I S H E D S Y N
E C V L I S T E N r e a d ( ) / w r i t e Connection termination Connection establishment fin/ack ack/- Legend: event/Tx segment passive open/- active open/syn syn/syn,ack ack/- close/fin 2 MSL timeout/- (MSL = 1 minute) ack/- close/fin fin/ack syn,ack/ack
CLOSED FIN-WAIT-2 LISTEN CLOSE-WAIT TIME-WAIT LAST-ACK SYN-SENT SYN-RECEIVED FIN-WAIT-1 ESTABLISHED
Llorenç Cerdà-Alabern
l i n u x # n e t s t a t
t A c t i v e I n t e r n e t c
n e c t i
s ( w /
e r v e r s ) P r
e c v
S e n d
L
a l A d d r e s s F
e i g n A d d r e s s S t a t e t c p 1 2 8 6 1 9 2 . 1 6 8 . . 1 2 8 : 2 9 5 3 7 1 9 9 . 1 8 1 . 7 7 . 5 2 : 8 E S T A B L I S H E D t c p 1 9 2 . 1 6 8 . . 1 2 8 : 1 3 6 9 6 7 . 1 9 . 9 . 2 : 8 T I M E _ W A I T t c p 1 1 9 2 . 1 6 8 . . 1 2 8 : 1 2 3 3 9 6 4 . 1 5 4 . 8 . 1 3 2 : 8 F I N _ W A I T 1 t c p 1 1 9 2 . 1 6 8 . . 1 2 8 : 2 9 5 2 9 1 9 9 . 1 8 1 . 7 7 . 5 2 : 8 S Y N _ S E N T t c p 1 1 9 2 . 1 6 8 . . 1 2 8 : 1 7 7 2 2 6 6 . 9 8 . 1 9 4 . 9 1 : 8 C L O S E _ W A I T t c p 1 9 2 . 1 6 8 . . 1 2 8 : 1 4 8 7 5 2 1 . 2 1 . 1 3 6 . 3 6 : 8 E S T A B L I S H E D t c p 1 9 2 . 1 6 8 . . 1 2 8 : 1 2 8 4 6 7 . 1 8 . 1 1 4 . 6 2 : 8 E S T A B L I S H E D t c p 1 1 9 2 . 1 6 8 . . 1 2 8 : 2 5 2 3 2 6 6 . 1 5 . 8 7 . 2 : 8 L A S T _ A C K t c p 1 9 2 . 1 6 8 . . 1 2 8 : 2 9 8 2 6 6 . 1 2 . 9 . 1 4 7 : 8 E S T A B L I S H E D t c p 1 9 2 . 1 6 8 . . 1 2 8 : 2 9 8 2 1 6 6 . 1 2 . 9 . 1 4 7 : 8 E S T A B L I S H E D t c p 1 1 2 7 . . . 1 : 2 5 9 1 1 1 2 7 . . . 1 : 8 C L O S E _ W A I T t c p 1 2 7 . . . 1 : 2 5 9 1 2 1 2 7 . . . 1 : 8 E S T A B L I S H E D t c p 1 2 7 . . . 1 : 8 1 2 7 . . . 1 : 2 5 9 1 1 F I N _ W A I T 2 t c p 1 2 7 . . . 1 : 8 1 2 7 . . . 1 : 2 5 9 1 2 E S T A B L I S H E D T h e c
n t
b y t e s n
c
i e d b y t h e u s e r p r
r a m c
n e c t e d t
h i s s
k e t . T h e c
n t
b y t e s n
a c k n
l e d g e d b y t h e r e m
e h
t . man netstat
Llorenç Cerdà-Alabern
TCP sender TCP receiver decrease cwnd Congestion losses
Llorenç Cerdà-Alabern
I n i t i a l i z a t i
: c w n d = M S S ; N O T E : R F C 2 5 8 1 a l l
s a n i n i t i a l w i n d
2 s e g m e n t s . s s t h r e s h = i n fj n i t y ; E a c h t i m e a n a c k c
fj r m i n g n e w d a t a i s r e c e i v e d : i f ( c w n d < s s t h r e s h ) { c w n d + = M S S ; / * S l
S t a r t * / } e l s e { c w n d + = M S S * M S S / c w n d ; / * C
g e s t i
A v
d a n c e * / } W h e n t h e r e i s a t i m e
t : R e t r a n s m i t s n d _ u n a ; s s t h r e s h = m a x ( m i n ( a w n d , c w n d ) / 2 , 2 M S S ) ; c w n d = M S S ;
Receiver Sender t t ...
t i m e
t duplicated acks w i n d
= 4 CA SS
... Time-out Example:
Llorenç Cerdà-Alabern
I n i t i a l i z a t i
: c w n d = M S S ; s s t h r e s h = i n fj n i t ; E a c h t i m e a n a c k c
fj r m i n g n e w d a t a i s r e c e i v e d : i f ( c w n d < s s t h r e s h ) { c w n d + = M S S ; / * S S * / } e l s e { c w n d + = M S S * M S S / c w n d ; / * C A * / } W h e n t h e r e i s a t i m e
t : R e t r a n s m i t s n d _ u n a ; s s t h r e s h = m a x ( m i n ( a w n d , c w n d ) / 2 , 2 M S S ) ; c w n d = M S S ; losses losses losses t / RTT 5 10 15 20 25 30 35 40 5 10 15 20 25 30 35 40 45 50 awnd ssthresh wnd / MSS ssthresh 45 50 55 65 65 CA SS SS CA SS CA min(cwnd, awnd) timeout timeout timeout SS
Llorenç Cerdà-Alabern
Llorenç Cerdà-Alabern
Llorenç Cerdà-Alabern
Llorenç Cerdà-Alabern
Receiver Sender t t ...
RTO1 RTO2 RTO3 RTO4 2 x RTO4 4 x RTO4 RTO5 RTO4 2 x RTO4 RTO6