The Transport Layer: TCP and UDP - - PDF document

the transport layer tcp and udp
SMART_READER_LITE
LIVE PREVIEW

The Transport Layer: TCP and UDP - - PDF document

COLE POLYTECHNIQUE FDRALE DE LAUSANNE The Transport Layer: TCP and UDP Contents


slide-1
SLIDE 1

1

  • The Transport Layer: TCP and UDP
  • ÉCOLE POLYTECHNIQUE

FÉDÉRALE DE LAUSANNE

  • Contents

!"# $ %& ' ((# ) (&* + (&*,

slide-2
SLIDE 2

2

  • 1. Error Recovery
  • ,%"%

%

  • "%.%%% !!
  • The Philosophy of Errors in a Layered Model

(##!#"/ %# !0123

  • "!#"##&

4#25&,#!12 42≥ &,#12601237/ &82,%603 9#9/ .03/ 0/ 3.0/ 3

((&*8-*

1##≥ """ #: ;<= %

1>!: 4&#

? ? ? ? 6%1%%1 "!!%"! %&2&! " ? ? ? ?#1! solution

slide-3
SLIDE 3

3

  • The Layered Model Transforms Errors into

Packet Losses

*

# 4& "" "%.

  • @>!#
  • ?

? ? ? .!>!

solution A R1 R2 B * * * * * * *$ *' *' *' *$!. *$ *$ A R1 R2 B * * * * * * *$ *$ *$ *$ *$!. *' *' *$ *'

(",!

  • (."

"%..:

:4 "" "4. !. #:#% A % >

  • (.!" ".#(

#%!>#:

((&*8-*!#!! 6##!A" !

B!!!"!#"%7! . B#!7! !!#C

  • *!#"%,!%#

#

2#$"2"!

The Case for End-to-end Error Recovery

R2 B A R3 R4 R1 1 4 2 3 5 6 7

slide-4
SLIDE 4

4

  • The Case for Hop-By-Hop Error Recovery

(.!" "#.#( !,%%"%.

&#":%2 !4! #,∈D,E(# 2×038

(!,">!, 8" F%!G 8"" (0*23"!0123"%," ,"".: *29/ 0/ 123

  • The Capacity of the End-to-End Path

%!#"% #.

4!:!H!!2

  • ?

? ? ? !#%%# # A R1 R1 R1 R1 R1 R1 B Loss probability links solution

slide-5
SLIDE 5

5

  • End-to-end Error Recovery is Inefficient when

Packet Error Rate is high

(%#"""

  • &:#%

. ? ? ? ?6%"..!" .##

GGGG× 2 GGG× 2

  • G)× 2

+× 2 )

  • & 0

#3 & 0 3 *

  • solution
  • Conclusion: Where is Error Recovery located in

the TCP/IP architecture ?

((&*8-*!

( 4&#I" %# ( 4&# 0%%, %3!!#!-A" 4&# $ 1#!!!

(,

4 4&## 0%3

  • #!0##3
slide-6
SLIDE 6

6

  • 2. Mechanisms for Error Recovery
  • %!".
  • !#:

? ? ? ?% ;J>!"! *!.!- ".-4!2 2C 042?3 (&*42?

solution

  • ARQ Protocols

#

2

42?

2 <,! !#

6% 42?%

;!;J :

  • !#""!#

6% ("!!"%.! %

*#".%%,%% %%

slide-7
SLIDE 7

7

  • Why Sliding Window ?

#

@!!"; J ? ? ? ?%!"; J

  • 4%! !

!: C""!# #. (!# .%%(. %%! !"!#

  • ""

* * * * 4 4 4 4 * * * * * * * * 4 4 4 4 * * * *

  • *

* * *. . . . * * * *

  • K

K K K * * * * ** ** ** ** ** ** ** *** * * *

  • **

** ** *** * * *

  • K

K K K 2 2 2 2 "" "" "" ""

  • How Sliding Window Works.

Usable Window

P = 1 A = 0 P = 0 A =2 P = 2 P = 3 P = 4 A =1 P = 5 P = 6 P = 7 P = 8 P = 9 A =3 P = 10 A =4 A =5 A =6 A =7 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12

Legend Maximum Send Window = Offered Window ( = 4 here)

slide-8
SLIDE 8

8

  • @>!,!,,,

(.%%%"%: %%L "->!">-.,!# # !.#(.%% C,#!:!"%. 59 !>!!%%,""%% " !"0#3 %.!# %% "!"!# ""!(%%%# !>!! %% %"!>!!%%!! %. !>!!%% 0!.3"%.!" %%!%% 4.%%.%% .%%, !>!!!" ""C.093""

  • ",.%%."

F"0"3"%%L ": ≥ 8,%%#, L&#,!!!!%%L !!!%%L !!!%%L !!!%%L "FL% "FL% "FL% "FL%

  • #

# # #

  • An Example of ARQ Protocol with Selective

Repeat

  • !

! ! ! " " " "

  • !

! ! !

  • !

! ! ! ! ! ! ! ! ! ! ! !" !" !" !" # # # # $%& $%& $%& $%&

  • '

' ' ' (% (% (% (% %) %) %) %) *+ *+ *+ *+

  • ,-

,- ,- ,- ... ... ... ...

  • ,-

,- ,- ,-

  • !

! ! !

  • !

! ! ! ! ! ! ! ,- ,- ,- ,- ! ! ! ! " " " "

slide-9
SLIDE 9

9

  • (%>!"42?,%

"%.: !#,."! %% L9'H $ 4%.! ># % . %. ' #! % %.!

  • ) ,#

! 0 ; 23 ? ? ? ? - % ! % % #

  • An Example of ARQ Protocol with Go Back N

' ' ' ' %),& %),& %),& %),& %) %) %) %) + + + + /01 /01 /01 /01

  • *

* * * (% (% (% (% %) %) %) %) *+ *+ *+ *+ /011 /011 /011 /011

  • *

* * * $% $% $% $% *+ *+ *+ *+

  • &

& & & /01 /01 /01 /01

  • ,-

,- ,- ,-

  • ,-

,- ,- ,-

  • ,-

,- ,- ,-

  • ,-

,- ,- ,-

  • %

% % %

  • %

% % % % % % % % % % %

slide-10
SLIDE 10

10

  • (%>!"42?,%"%.:

%% L9'H 4%.! !, . ! % % # $ #! ' , !. "! %. 0 J3 ? ? ? ? - % ! % % # ; J "" , % !# # ! % # !- . >! !#:

0 !!# 3- "A > -",C "" A 0 .3( #!

J "# !!!,">!

  • An Example of ARQ Protocol with Go Back N

and Negative Acks

  • /01

/01 /01 /01

  • /01

/01 /01 /01

  • ,-

,- ,- ,-

  • *234

*234 *234 *234

  • %

% % %

  • ,-

,- ,- ,-

  • ,-

,- ,- ,-

  • !

! ! !

  • *234

*234 *234 *234 % % % %

  • %

% % %

  • /01

/01 /01 /01

slide-11
SLIDE 11

11

  • (%>!"42?,%

"%.: %% L9'H 4%.! . !4 % % " 4. % " % $ #! # " . ' , !. "! %. 0J3 ? ? ? ? " " !

  • Where are ARQ Protocols Used ?

6#

4&#

!:;2 :;J

1

(#:

(&*:"%!"".

4#

<B;:;J

slide-12
SLIDE 12

12

  • Are There Alternatives to ARQ ?

&. 42? %1&01&3: *:

" 4 # 0>2;! 3. K

  • " " K ,

? ? ? ?

  • "

@ 1&! " 0>" ! !# % / ">!: #% A3

  • FEC may be combined with ARQ

1>!%!,.." ;"!H

4 ! C " !H" K

  • " .,

K, K$, M # 4 "" 4# ## % " = "-

slide-13
SLIDE 13

13

  • 3. Flow Control

#

<""!"!:4!#!" @!##!# !4 <!#"""/ %"N %"""%

6% %

, &

%& %& %& %& ≠ &. &. &. &.

. . !# %

  • Backpressure Flow Control

< ;(@*09*4=;13 J@!. ;. "> ! " . ;(@*!. ;!!! ? ? ? ? % %

  • !!

O@B8O@ ! % .4B

"! 0%3

  • 5

5 5 5

  • 5

5 5 5 65 65 65 65 ! ! ! ! " " " " # # # #

slide-14
SLIDE 14

14

  • Can we use Sliding Window for Flow Control ?

@ . %% ""%,"% 4! . 42? % . %%(%% L ' "" "' 4!# . . " "">!,A 0 3'<% "' # % ! ! ? ? ? ? < "%!

  • Credit Flow Control

0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 P = 1 A = -1, credit = 2 P = 0 P = 2 P = 3 P = 4 A = 0, credit = 2 P = 5 P = 6 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 A = 2, credit = 4 0 1 2 3 4 5 6 7 8 9 10 11 12 A = 0, credit = 4 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 A = 4, credit = 2 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 A = 6, credit = 0 0 1 2 3 4 5 6 7 8 9 10 11 12 A = 6, credit = 4 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 P = 7

slide-15
SLIDE 15

15

  • ( ! % . . %% ""%

& #(&*, ! "P%% !Q !, "! %! %. 0"""3& !# " ,% , "42?& ! % ""% , %.! " ! #. # 0 C !# # , .!!# ! !# !3

  • ( %!>!! %% 0 P"" %%Q (&*30

3%% 0 >3@, % (&*, 09 %% !3. % %.!( %.! !

  • & !.. "!>!! %%02!!

%.! !" . "!>!! %%3

  • #%.. ! . ",

!! . "" "! KK-, 0% 3 ! K .,!#, .. "!>!! %% ! " 0 !# # #! 3

  • 4 "! . " 9,!.#,"

C ! "%. # , ! " %.

  • (&*, !# %# # " "

0%% ,.. #(!3R L %%, 0 3

  • Credits are Modified as Receive Buffer Space Varies

4 4 4 4% % % %

  • 7

7 7 74 4 4 4% % % %

  • 4

4 4 4% % % %

  • !

! ! ! " " " " 4 4 4 4% % % %

  • 4

4 4 4% % % %

  • "4

"4 "4 "4% % % %

  • "4

"4 "4 "4% % % %

  • #

# # # !" !" !" !" !" !" !" !" #89 #89 #89 #89

  • !"

!" !" !" !" !" !" !" !" !" !" !" #89 #89 #89 #89

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • !

! ! ! 7 7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • !

! ! ! " " " " 7 7 7 7

  • 7

7 7 7

  • 7

7 7 7

  • !

! ! ! " " " " +4 +4 +4 +4%) %) %) %)

  • %)

%) %) %) + + + +: : : :

slide-16
SLIDE 16

16

  • (".%% ""#

( (&* !! !# "" ( %% .. # " ""("% ! ( "" "' 0! "L"!#3< !# "" # "C 0 % 3, . , #, # ! ( %% 093# %.!( C "" % -" , !# "" # 0 "C3-, C ""L,!! " C( > ! %% # ! !

  • 4. The Transport Layer

2!:

%K K# # # # # # ! % .! #! #,

  • (&*8-* % #

=<*0=<.!*3:""#.!!.", " (&*0(!&*3:!!#K "%

slide-17
SLIDE 17

17

  • Why both TCP and UDP ?

(&*=<*, .## !#%#(&* 0#!3

>!:S ? ? ? ? %#

  • >!:A!.,!

0<B;3(&*"" ."!.; # ;J# >!:!0(&*!-*3

  • UDP Uses Port Numbers

6

  • *9

6

  • *9

6

  • *94

6

  • *94
  • *;494<499=<*

9+ 9)$ MM

  • =<*
  • C
  • (&*
  • *

+

  • =<*
  • C
  • (&*
  • *

)$

  • *%

=<*;* =<*< * =<* .. =<*&!

  • *

=<*.!

  • *.!
slide-18
SLIDE 18

18

  • (%%09.!3, ,

!!.1"!#%,% ".

  • ,#!0#:#!!3
  • *

(>!%#!4, !(=<* (! !H#H% "!4 (=<*!=<*

  • *.&!!

"!##!*+..(# "##!#(##,! "# ;%%H">!,<B; )$0883*#!# !(##'-"#%# % !.!!.!,#" #%!#

  • The UDP service

=<*"

!.,TU ,,,

=<*!.

>#!.. !.!# .!#,!!!#

  • "=<*!.. (=,".!
  • *#
slide-19
SLIDE 19

19

  • UDP is used via a Socket Library
  • (#

.!!."(&* =<* (".%# =<*.!( ." ,%!# 0#3

03 !09"3 "" 03 !% 03.-* ,! !. !03 !." !--* ! !.

  • 03H

03H 03H 03H

  • 03H

03H "!03H F8& 547A! F F8; V F

  • How the Operating System views UDP

9$ 9' "" "" 9$')+ 9$+)' .! =<*

  • *

9TT)T'

slide-20
SLIDE 20

20

  • 5. TCP basics

#

2 ;"!.

(&*

(&*.C%, H (&*%"",! .C (&*%%!-*,=<* (&*"% (&*.0!3

6% (&*%

",09#L"C!3 %% (&*!!42?0"#30""% 3 ,

  • The TCP Service

(&*""!

4!"#"!

  • (&*!=<*.(&*T"%
  • (&*C"

" 4(&*"#:

  • *
  • *
  • *
  • *
  • ,

, , ,

  • ,

, , ,

  • *
  • *
  • *
  • *
  • ,

, , ,

slide-21
SLIDE 21

21

  • TCP views data as a stream of bytes

(&**<= (&*.!

#!"".(&* .! ;;9!>!!P.!P L0!>!!L3

P ;;9$+Q !.!,%, >$+#

)$+##"0)+#-*3

;C!#, (&*.!"%

  • =<*

(&*.!".!

#!%-*' %".!!

(&* (&*

  • *9(&*.!
  • *

9(&*

  • TCP is an ARQ protocol

:

.%% #! !#". &!

;!#!

"! %.!

%# &.

%

slide-22
SLIDE 22

22

  • TCP Basic Operation

T:T)0)3 %+ :03 T)%' T):G0)3 %'' G:G)0)3 %'' G):0)3 %'' 03 T)%$ T):G0)3 )%'' :)0)3 T)% ):'0)3 % :)0)3 '%'' (!N

  • $

' ) +

  • T

G

  • #

:T)

  • #

T):

  • #

:)

4

  • 2!

" ',),+

  • (%!>."!.1#

C!"#H, %.!"## C(,%%.! C!"4%.! 0P..#.Q3,(&*1# .!C!0""3, ! 0"3("%.:

"#Q:Q#KP0P.!<.Q3Q B!KP%Q ""%;BK% # !

4T,!!>,.!" .%#!T)0J3B % ".!G,!%#! (.! " (%%"0%3.L"%%@## !%%!#(! "% B!"."!#2 >! !%$ (C! ,!.'W (".%!!"(&*%P(&*;4&UQ,% "!!4!!0P(&* (Q3.!"!H,% !!.JH%% %!#,# !

slide-23
SLIDE 23

23

  • Losses are Also Detected by “Fast Retransmit”

# :! !"# >!!" .J "";2*

< 2!#!.

  • 6% %

"$ "! #" !!, ! ? ? ? ?% ".

  • *

* *$ *' 4 4 4 *) *+ 4 4 ! *$ 4 *

  • Selective Acknowledgements

#

!%%"," "% 4%.>#%#% !

6%

$;4&U(&*,H;4&U ""#H"! # #.%.!

  • ".,!.#!
slide-24
SLIDE 24

24

  • TCP uses Connections

(&*C09#L3 "!.

=.C!

(>%"(&*:

"",(&*. ;B(""#L (C!!! (!"%#(% ."%"

  • 2!!(&*#%H

%

  • TCP Connection Phases

SYN, seq=x syn_sent SYN seq=y, ack=x+1 ack=y+1 established established snc_rcvd listen FIN, seq=u ack=v+1 ack=u+1 FIN seq=v fin_wait_2 time_wait close_wait last_ack closed application active open passive open application close: active close fin_wait_1 Connection Setup Data Transfer Connection Release

slide-25
SLIDE 25

25

  • padding
  • ptions (if any)

srce port dest port sequence number ack number hlen window

code bits

rsvd urgent pointer checksum segment data (if any) TCP header (20 Bytes +

  • ptions)

IP header (20 B + options) <= MSS bytes

code bit meaning urg urgent ptr is valid ack ack field is valid psh this seg requests a push rst reset the connection syn connection setup fin sender has reached end of byte stream

  • TCP Segment Format

(>%(&*.!"!

  • ##.(&*H" (&*

..!!!#-",(&*!# .;<= 09(&*##3*<=09 .!3@.,"(&* !!#-",(&*!#.*<= ;<= ("!"(&*(&* ."#,%#(&*( #("#"

  • ..,#.

0..!3(.(&*! "!.@%, .! #!(#(# !!

  • 2;(21;1(!!-
  • ;B-B(#

!C!

  • (C!""#( !

>>C!

  • @">! >!!;.!;L0 ;;3!#;B

.!0."!>!!L" !3

  • (!!#
slide-26
SLIDE 26

26

  • TCP is used via a Socket Library

(".%# (." % #

03 !09"3"" 03! % 03!-* !% ;B 03" ! 03!".H ;B "!- %03 " %% 03" #! !!.! "%!##!# %-!" #""# "

% ./tcpClient <destAddr> bonjour les amis % % ./tcpServ & % client socket(); server socket(); bind(); connect(); send(); close(); bind(); listen(); accept(); receive(); close();

  • How the Operating System views TCP Sockets

program TCP IP id=3 id=4 incoming connection queue buffer port=32456 address=128.178.151.84 id=5 buffer socket socket socket

slide-27
SLIDE 27

27

  • Test Your Understanding

&=<*(&*

? ? ? ?%! ? ? ? ? =<*""#. #%!4#L:,,!. ?$ ?$ ?$ ?$ (&*"!.#. #%!4#L:,,!.

@!C

?' ?' ?' ?' -;J.%%

  • 6. TCP, advanced

(&*!!.!"!!#

(R <.42?"%.%#!"! !.!>!>

  • (%.#"."!>#"(&*

B!#(&*,%

  • &.(&*

&.%#"0. %3-1(!!(&*/ %%# !." .!

slide-28
SLIDE 28

28

  • When to send an ACK

#

..!,(&*!# %.!!!#,!#% 0P..#.Q3,.!0! 3<#.4&U ., !#!"-*%6%, " 4&U #.,.#" "!"42?!4,#. 4&U #%"!%%L

.!.

<%4&U%

6% A

;.4&U##!)-,!" "L.!,4&U"# .! B.(&*4&U 0##4&U3 ".!"-,4&U !#CK

  • Nagle’s Algorithm

#

4(&*." #01/ ..!(%#! !0>:(:!3J.. #%!#!!,#

.!.

<%.!-*#"!

6% A

#%.#.! 09.!! ;;3: B.R .! #

>!:O%% #!0(&*XB@<143 "B. ,

(data written by upper layer) or (new ack received) -> if full segment ready then send segment else if there is no unacknowledged data then send segment else start override timer; leave

  • verride timer expires -> create segment and send

(data written by upper layer) or (new ack received) -> if full segment ready then send segment else if there is no unacknowledged data then send segment else start override timer; leave

  • verride timer expires -> create segment and send
slide-29
SLIDE 29

29

  • Example: Nagle’algorithm

8000:8001(1) ack 101 win 6000 1

A B

a -> b -> c -> d -> e -> f -> 101:102(1) ack 8001 win 14000 2 8001:8003(2) ack 102 win 6000 3 102:102(0) ack 8003 win 13998 4 8003:8005(2) ack 102 win 6000 102:102(0) ack 8003 win 14000 5 6 102:102(0) ack 8005 win 13998 7 8005:8006(1) ack 102 win 6000 8

  • Silly Window Syndrome Avoidance: Why ?

;#% ;#! %

2 %# .!" !%%"!#!7%"

  • %)

%) %) %) ; ; ; ;77777 77777 77777 77777 < < < <77777 77777 77777 77777= = = =+> +> +> +>4 4 4 4+ + + +

  • <

< < <77777 77777 77777 77777= = = =+ + + +

  • %)

%) %) %) 4; 4; 4; 4;77777 77777 77777 77777 ,%:< ,%:< ,%:< ,%:<

  • %)

%) %) %) 4; 4; 4; 4;77777 77777 77777 77777 < < < <77777 77777 77777 77777= = = =

  • ,%:<

,%:< ,%:< ,%:<

  • %)

%) %) %) 4; 4; 4; 4;77777 77777 77777 77777 < < < <77777 77777 77777 77777= = = =

  • ,%:<

,%:< ,%:< ,%:<

  • %)

%) %) %) 4; 4; 4; 4;77777 77777 77777 77777 < < < <77777 77777 77777 77777= = = =

slide-30
SLIDE 30

30

  • Silly Window Syndrome Avoidance

;;

* "! . ! ! %%

6% ;; %

!%% #! . ;; 8%-

%- %- %-< < < <

keep nextByteExpected + offeredWindow fixed until: reserve · min (MSS, 1/2 receiveBuffer) keep nextByteExpected + offeredWindow fixed until: reserve · min (MSS, 1/2 receiveBuffer)

?&?: ?&?: ?&?: ?&?: :(% :(% :(% :(% 777 777 777 777@ @ @ @77777777777 77777777777 77777777777 77777777777@ @ @ @777777777777777777777 777777777777777777777 777777777777777777777 777777777777777777777@ @ @ @777777777777 777777777777 777777777777 777777777777@ @ @ @7777 7777 7777 7777 ; ; ; ;77 77 77 77

  • 77

77 77 77=; =; =; =;7 7 7 7 -

  • 7

7 7 7= = = = ; ; ; ;77777777777777 77777777777777 77777777777777 77777777777777 %- %- %- %- 7777777777777777 7777777777777777 7777777777777777 7777777777777777= = = =

  • SWS Avoidance Example

ack 0 win 2000 <----- 0:1000 -----> bufferSize= 2000B, freebuf = 1000B, reserve = 0B 1000:2000 -----> freebuf= 0B, reserve = 0B ack 2000, win 0 <----- application reads 1 Byte: freeBuf=reserve=1B, .... application has read 500 B: reserve = 500 persistTimer expires window probe packet sent 2000:2001 -----> data is not accepted (out of window) ack 2000, win 0 <----- .... application has read 1000 B: reserve = 1000 ack 2000, win 1000 <----- 2000:3000 ----->

slide-31
SLIDE 31

31

  • ( ;; "

# & % !! ;; / 2& "% %

? ? ? ? "" A% B.R .! ;;

  • Round Trip Estimation

# (!! ! .# . !, ! . 2((!! 2(@ ! 6%

sampleRTT = last measured round trip time estimatedRTT = last estimated average round trip time deviation = last estimated round trip deviation initialization (first sample): estimatedRTT = sampleRTT + 0.5s; deviation = estimatedRTT/2 new value of sampleRTT available -> Err = sampleRTT - estimatedRTT estimatedRTT = estimatedRTT + 0.125 * Err deviation = deviation + 0.250 * (|Err|- deviation) RTO = estimatedRTT + 4*deviation sampleRTT = last measured round trip time estimatedRTT = last estimated average round trip time deviation = last estimated round trip deviation initialization (first sample): estimatedRTT = sampleRTT + 0.5s; deviation = estimatedRTT/2 new value of sampleRTT available -> Err = sampleRTT - estimatedRTT estimatedRTT = estimatedRTT + 0.125 * Err deviation = deviation + 0.250 * (|Err|- deviation) RTO = estimatedRTT + 4*deviation

slide-32
SLIDE 32

32

  • Sample RTO

2 4 6 8 10 12 14 1 11 21 31 41 51 61 71 81 91 101 111 121 131 141 seconds seconds RTO SampledRTT

  • Conclusions

(&*.!! (&*!>!>,%"-%% %!. ." (&*!!>%!! .,%%#"%

slide-33
SLIDE 33

33

  • Solutions
  • The Philosophy of Errors in a Layered Model

(##!#"/ %# !0123

  • "!#"##&

4#25&,#!12 42≥ &,#12601237/ &82

((&*8-*

1##≥ """ #: ;<= %

1>!: 4&#

? ? ? ? 6%1%%1 "!!%"! 4 4 4 4 -&2&-","! %&2&! " ? ? ? ?#1! 4 4 4 4 12#!#!,% back

slide-34
SLIDE 34

34

  • The Layered Model Transforms Errors into

Packet Losses

*

# 4& "" "%.

  • @>!#
  • ?

? ? ? .!>! 4 4 4 4.!# !#(( >.

back

  • The Capacity of the End-to-End Path

? ? ? ? !#%%# # 4 4 4 4

&:# 1*129/ 0/ 3 &#& 92× 03 &:## &#92× 03 1#& 92× 03

A R1 R1 R1 R1 R1 R1 B Loss probability links back

slide-35
SLIDE 35

35

  • End-to-end Error Recovery is Inefficient when

Packet Error Rate is high

(%#"""

  • &:#%

. ? ? ? ?6%"..!" .## 4 4 4 4

<###. :>,1 <#/# 4&#03,

  • $ -,#

GGGG× 2 GGG× 2

  • G)× 2

+× 2 )

  • & 0

#3 & 0 3 *

  • back
  • 2. Mechanisms for Error Recovery
  • %!".
  • !#:

? ? ? ?% 4 4 4 4.

*! <%.!"# ;%"H""( , !

;

  • *

4 *

  • 4

* ( R

back

slide-36
SLIDE 36

36

  • Why Sliding Window ?

#

@!!"; J ? ? ? ?%!"; J 4 4 4 4%%# #!, .!( %!%%."

  • 4%! !

!: C""!# #. (!# .%%(. %%! !"!#

  • ""

* * * * 4 4 4 4 * * * * * * * * 4 4 4 4 * * * *

  • *

* * *. . . . * * * *

  • K

K K K * * * * ** ** ** ** ** ** ** *** * * *

  • **

** ** *** * * *

  • K

K K K 2 2 2 2 "" "" "" ""

back

  • (%>!"42?,%

"%.:

  • !#,."!

%% L9'H $ 4%.! ># % . %. ' #! % %.!

  • ) ,#

! 0 ; 23 ? ? ? ? - % ! % % # # 4 4 4 4 ,"

slide-37
SLIDE 37

37

  • (%>!"42?,%

"%.: %% L9'H 4%.! !, . ! % % # $ #! ' , !. "! %. 0 J3 ? ? ? ? - % ! % % # 4 4 4 4,"

  • "
  • " K
  • (%>!"42?,%

"%.: %% L9'H 4%.! . !4 % % " 4. % " % $ #! # " . ' , !. "! %. 0J3 ? ? ? ? " " ! 4 4 4 4 -"! ( # #, !# % ".!" . ( !#

slide-38
SLIDE 38

38

  • Are There Alternatives to ARQ ?

&. 42? %1&01&3: *:

" 4 # 0>2;! 3. K

  • " " K ,

? ? ? ? 4 4 4 4 *: C !@%% # . #, " *:% "!, "" !# "" &: .:# ",42? ! "%

  • "

@ 1&! " 0>" ! !# % / ">!: #% A3

  • Backpressure Flow Control

< ;(@*09*4=;13 J@!. <. "> !" . ;(@* !. ;!!! ? ? ? ? % % 4 4 4 4 -"% # !

  • 5

5 5 5

  • 5

5 5 5 65 65 65 65 ! ! ! ! " " " " # # # #

slide-39
SLIDE 39

39

  • Can we use Sliding Window for Flow Control ?

@ . %% ""%,"% 4! . 42? % . %%(%% L ' "" "' 4!# . . " "">!,A 0 3'<% "' # % ! ! ? ? ? ? < "%! 4 4 4 4 , % . %% "L,! " %. · 6%, ! :%. !# !,% # % #

  • Why both TCP and UDP ?

(&*=<*, .## !#%#(&* 0#!3

>!:S ? ? ? ? %# 4 4 4 4#!"*! !#!

  • >!:A!.,!

0<B;3(&*"" ."!.; # ;J#

slide-40
SLIDE 40

40

  • Losses are Also Detected by “Fast Retransmit”

# :! !"# >!!" .J "";2*

< 2!#!.

  • 6% %

"$ "! #" !!, ! ? ? ? ?% ". 4 4 4 4 4+

  • *

* *$ *' 4 4 4 *) *+ 4 4 ! *$ 4 *

  • Test Your Understanding

&=<*(&*

? ? ? ?%! 4 4 4 4 "%(&* =<*# ? ? ? ? =<*""#. #%!4#L:,,!. 4 4 4 4 ",!!@ .#%#;!!#!. ?$ ?$ ?$ ?$ (&*"!.#. #%!4#L:,,!. 4$ 4$ 4$ 4$%(&* H!#!. ("#B#!.%#

  • @!C

?' ?' ?' ?' -;J.%% 4' 4' 4' 4' ,%%%9

slide-41
SLIDE 41

41

  • Sws avoid.

( ;; "

# & % !! ;; / 2& "% %

? ? ? ? "" A% B.R .! ;; 4 4 4 4 ! . !# ! B. " % # !# ! "H;; " # !! " .! #