lecture20-reliable-transport-covid · 2020-04-21 · goal of today’s lecture • understanding...

64
Computer Networks: Architecture and Protocols CS4450 Lecture 20 Reliable Transport Rachit Agarwal 1

Upload: others

Post on 08-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

ComputerNetworks:ArchitectureandProtocols

CS4450

Lecture20

ReliableTransport

RachitAgarwal

1

Page 2: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

Announcements

• Prelim

• Wewillhaveprelimon30thofApriland1stofMay

• Examreleasedoncanvasonthe30that00:01AMET

• Youcanstartworkingwheneveryouwant• Scannedcopiestobesubmittedby1stofMay,11:59AMET

• Overall48hourstofinishtheexam,submitthecopies

• Pleaseletusknowimmediatelyifthereisanissuewiththis

• Wewillpostapracticeprelim(andsolutions)byThursday

• However,itsforpracticeonly;themainprelimmaybedifferent

2

Page 3: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

GoalofToday’sLecture

• Understandingreliabletransportconceptually• Whatarethefundamentalaspectsofreliabletransport

• Backtoarchitecturalprinciplesforonelecture

• ThegoalisnottounderstandTCP• TCPinvolveslotsofdetailedmechanisms,coveredlater

• Groundrulesfordiscussion• NomentionofTCP

• Nomentionofdetailedpracticalissues

• Focusonlyon“ideal”worldofpacketsandlinks

3

Page 4: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

DecisionsandTheirPrinciples

• Howtobreaksystemintomodules?

• Dictatedbylayering

• Wherearemodulesimplemented?

• DictatedbyEnd-to-EndPrinciple

• Wherestateisstored?

• Dictatedbyfate-sharing

5

Page 5: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

TodayWeDesignReliableDelivery

• Theend-to-endprincipletellsus?• Putreliabilityintheend-host,notthenetwork

• Layeringdictatesputtingreliabilityinwhatlayer?• Abovenetworklayer• L4focussesonprocess-to-processdelivery(“flow”)

• Fatesharingtellsus?• Keepallreliabilitystateinends,notinnetwork

6

Page 6: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

BestEffortService(L3)

• Packetscanbelost• Packetscanbecorrupted• Packetscanbereordered• Packetscanbedelayed• Packetscanbeduplicated• …

Howcanyoupossiblemakeanythingwork

withsuchaservicemodel?

7

Page 7: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

ChallengeForToday

• Buildingastackthatsupportsreliabletransfer• Sothatindividualapplicationsdon’tneedtodealwithpacketlosses,etc.

• Whatmechanismscanweputinthetransportlayertoprovidereliability?

• Reliabilityisfocusedonsingle“flow”• Flow:streamofpacketsbetweentwoprocesses

• Usuallydefinedusingthe5-tuple:• (sourceIP,destIP,sourcePort,destPort,protocol)

8

Page 8: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

FourGoalsforReliableTransfer

• Correctness• Tobedefined

• “Fairness”• Everyflowmustgetafairshareofnetworkresources

• FlowPerformance

• Latency,jitter,etc.

• Utilization• Wouldliketomaximizebandwidthutilization

• Ifnetworkhasbandwidthavailable,flowsshouldbeabletouseit!

9

Page 9: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

StartWithTransferofaSinglePacket

• Wecanlaterworryaboutlargerfiles,butinthebeginningitiscleanertofocusonthissimplecase

10

Page 10: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

CorrectnessCondition

• Routinghadacleancorrectnesscondition

• Wewantsamekindof“ifandonlyif”characterizationof“correct”

reliabletransportdesigns

• Thisconditionisforthedesigntobecorrect,notthebestperformant

• Oneobviousrequirement:

• Transportneverclaimstohavedelivereddatathatwasn’tdelivered…

• Butweneedmorethanthat.What?

11

Page 11: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

CorrectnessCondition?

• Howabout:“Packetisalwaysdeliveredtoreceiver”?

• i.e.,Transportisreliableifandonlyifpacketsarealwaysdeliveredtothereceiver…

• Isn’tthatsimple?

12

Page 12: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

WRONG!

• Whatifnetworkispartitioned?

• Partitionedmeansthatthenetworkisbrokenintotwoormoredisconnectedcomponents…

• Wecan’tclaimatransportdesignisincorrectifitdoesn’tworkinapartitionednetwork!

• Afterall,thereisnowaytoreachthedestination!

13

Page 13: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

CorrectnessCondition?

• Packetisdeliveredtoreceiverifandonlyifitspossibletodeliverpacket

14

Page 14: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

WRONG!

• Ifthenetworkisonlyavailableatoneinstantoftime,onlyanOraclewouldknowwhentosend

• Wecan’tclaimatransportdesignisincorrectifitdoesn’tknowthe

unknowable…

• Soweneedtofocusonwhatthetransportdesignistryingtodo,notwhatitactuallyaccomplishes

15

Page 15: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

CorrectnessCondition?

• Resendpacketifandonlyiftheprevioustransmissionwaslostorcorrupted

• Thisisbetterbecauseitrefersto:• whatthedesigndoes(whichitcancontrol)• notwhetheritalwayssucceeds(whichitcan’t)

16

Page 16: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

WRONG!

• Impossible

• “CoordinatedAttack”overanunreliablenetwork

• Considertwocases:• Packetdelivered;allpacketsfromreceiveraredropped

• Packetdropped;allpacketsfromreceiveraredropped

• Theyareindistinguishabletosender• Inbothcases,packetwassent,andnofeedbackatall• Doesitresend,ornot?

17

Page 17: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

CorrectnessCondition?

• Packetisalwaysresentiftheprevioustransmissionwaslostorcorrupted

• Packetmayberesentatothertimes

• Note:• Thisinvariantgivesusasimplecriterionfordecidingifanimplementationiscorrect

• Efficiencyandsimplicityareseparatecriteria

18

Page 18: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

AlmostRight!

• What’swrongwithit?

• Animplementationthatneversentthepacketatallisreliableaccordingtothedefinition.

19

Page 19: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

CompleteCorrectnessCondition

• Atransportmechanismis“reliable”ifandonlyif

(a) Itresendsalldroppedorcorruptedpackets

(b) Itattemptstomakeprogress

• Makingprogressmeans:

• Ifthereisdatatosend,transporteventuallyattemptstosenddata

• Veryimportant:“eventuallyattempts”!

• Itshouldnotbeblockedforever

• And,itmaynotsucceed,butitmustattempt

• Example:Iftherearetenpacketstosend,transportcan’tjustsendthefirstfiveandthenstopforever

20

Page 20: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

CompleteCorrectnessCondition

• Atransportmechanismis“reliable”ifandonlyif

(a) Itresendsalldroppedorcorruptedpackets

(b) Itattemptstomakeprogress

• Sufficient(“if”):transportalgorithmwillkeeptryingtodeliverpackets

thathavenotyetreachedthedestination

• Necessary(“onlyif”):ifiteverletsapacketgoundeliveredwithouttryingagain,ornevertriestosendapacketwhenallothershavebeen

delivered,itisn’treliable

21

Page 21: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

Note!

• Atransportmechanismcan“giveup”,butmustannouncethisto

application

• Ifthetransportmechanismhastriedforsomeperiodtodeliverthedata,andhasnotsucceeded:

• Itmightdecidethatitisbettertogiveup

• Andapplicationscanreinitiatedatatransfer• Thatisallowed…

• Butitcanneverfalselyclaimtohavedeliveredapacket

22

Page 22: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

WehaveCorrectnessCondition

23

• Howdoweachieveit?

• Focusonsingle-packetsolutions

Page 23: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

FourGoalsforReliableTransfer

• Correctness

• “Fairness”• Everyflowmustgetafairshareofnetworkresources

• FlowPerformance

• Latency,jitter,etc.

• Utilization• Wouldliketomaximizebandwidthutilization

• Ifnetworkhasbandwidthavailable,flowsshouldbeabletouseit!

24

Page 24: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

Solutionv1

• Sendthepacketasoftenandfastaspossible…

• Isitcorrect• No.• Why?

• The“if”conditionisnotsatisfied:(a) Transportmustattempttomakeprogress

• Nowaytocheckwhetherthepacketwasdroppedorcorrupted• So,mustcontinuesendingthesamepacket

• Willnevermakeprogressonotherflows(fromsamesource)

25

Page 25: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

What’smissing?

• Feedbackfromreceiver!

• Ifreceiverdoesnotrespond,nowayforsendertotellwhentostopresending

• Cannotachievecorrectnesswithoutfeedback

26

Page 26: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

FormsofFeedback

• ACK:Yes,Igotapacket

• NACK:No,Ididnotgetthepacket

• WhenisNACKanaturalidea?

• PacketCorruption(Igotpacket#5butitwascorrupted)

• IgnoreNACKsforrestofthelecture…

27

Page 27: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

Solutionv2

• ResendpacketuntilyougetanACK• Andreceiversendsper-packetACKsuntildatafinallystops

• Correct?• Yes:

• Alldropped/corruptedpacketswillberetransmitted• Thetransportwillattempttomakeprogress

• Fair?• Overlong-term,yes:

• allsourceswillgetanequalchancetousenetworkresources

• Flowperformance?• Goodbutnotnecessarilyoptimal

• Unnecessarilyretransmittedpacketsmayinflatelatency

• Utilization:• suboptimal;packetsretransmittedunnecessarily28

Page 28: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

Solutionv3

• Sendpacket• Butnow,setatimer

• Whenreceivergetspacket,sendsACK

• IfsenderreceivesACK,done• IfnoACKwhentimerexpires,resend

• Stillcorrect,andfair• Performancewouldargueforsmalltimeout

• Utilizationwouldargueforlargertimeout

• Maywanttoincreasetimereachtimeyoutry

• Maywanttocapthenumberofretries

• Problemswiththisdesign?

29

Page 29: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

Have“Solved”theSinglePacketCase

• Sendpacket• Setatimer

• IfnoACKwhentimergoesoff,resendpacket

• Andresettimer

• Tradeoffbetweenperformanceandutilizationinselectionoftimeout:

• Toosmall:unnecessaryretransmissions(underutilization)

• Toolarge:waitingunnecessarily(poorperformance)

30

Page 30: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

MultiplePackets

• Servicemodel:reliablestreamofpackets

• Handupcontiguousblockofpacketstoapplication

• Whynotusesingle-packetsolution?

• Sendthenextpacketoncethefirstonehasbeendelivered• Problem:Onlyonepacket“inflight”atatime

• LowEffectivethroughput:PacketSize/RTT

• Usewindowbasedapproach• AllowforawindowofWpacketsin-flightatanytime(unack’ed)

• Slidethewindowaspacketsareack’ed• SlidingwindowimpliesWpacketsarecontinuous

31

Page 31: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

Window-basedAlgorithms

• Verysimpleconcept

• SendWpackets

• WhenonegetsACK’edsendthenextpacketinline

• Itreallyisthatsimple(untilwegottoTCP)

• Willconsiderseveralvariations…

• Butfirst…

32

Page 32: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

HowBigShouldtheWindowbe?

• Windowsservethreepurposes

• Takingadvantageofthebandwidthofthelinks• Limitingbandwidthusedbyaflow(congestioncontrol)

• Limitingtheamountofbufferingneededatthereceiver

• Whydoreceiversneedtobufferpackets?

• Answer:packetre-ordering(discussedlater)

• Ifweignoreallbutthefirstgoal,thenwewanttokeepthesenderalwayssending(intheidealcase)

• RTT:fromsendingfirstpacketuntilreceivedfirstACK

• Condition:• RTTxB~WxPacketSize

33

Page 33: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

Whatdoesthismean?

• Bistheminimumlinkbandwidthalongthepath

• Obviouslyshouldn’tsendfasterthanthat

• WewanttosetWsuchthat:

• ifIamsendingatrateB,then

• theACKofthefirstpacketarrives• exactlywhenIjustfinishsendingthelastofmyWpackets

• Letsmesendasfastasthepathcandeliver…

34

Page 34: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

RTTxB~WxPacketSize

• RecallthatBandwidthDelayProduct• BDP=bandwidthxpropagationdelay

• BxRTTismerely2xBDP

• Windowsizingrule:

• Totalbitsinflightisroughlytheamountofdatathatfitsinto

forwardandreverse“pipes”

• Herepipeiscompletepath,notsinglelink…

• Thisisnot“detail”,thisisafundamentalconcept…

bandwidth

Propagation delay

delay x bandwidth

35

Page 35: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

WhereAreWe?

• Figuredoutcorrectnesscondition:• Alwaysresendlost/corruptedpackets• Alwaystrytomakeprogress(butcangiveupentirely)

• Figuredoutsinglepacketcase:• Sendpacket,settimer,resendifnoACKwhentimerexpires

• Someprogresstowardsmultiplepacketcase:

• Allowmanypackets(W)inflightatonce

• Andknowwhattheidealwindowsizeis• RTTxB/Packetsize

• What’slefttodesign?

36

Page 36: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

ThreeDesignConsiderations

• Natureoffeedback• WhatshouldACKstelluswhenwehavemanypacketsinflight

• Detectionofloss

• Responsetoloss

37

Page 37: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

ACKIndividualPackets

• Natureoffeedback:simple-thereceiverACKseachpacket

• Responsetoloss:moderate:

• +RetransmitthepacketforwhichACKnotreceived

• +Reorderingnotaproblem

• +Simplewindowalgorithm

• Windependentsinglepacketalgorithms

• Whenonefinishesgrabnextpacket

• -LossofACKpacketrequiresaretransmission

38

Page 38: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

FullInformationFeedback

• Listallpacketsthathavebeenreceived• GivehighestcumulativeACKplusanyadditionalpackets

• Ifpackets1,2,3,4,6received:sendACK(4,6)

• Strengths?• Asmuchinformationasyoucouldhopefor

• ResilientformofindividualACKs

• Weaknesses?

• Couldrequiresizableoverheadinbadcases• Feasibleifonlysmallholes

• Ifpackets1,2,3,4,6,….,100received:ACK(4,6,…,100)

39

Page 39: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

• Natureoffeedback:complex-feedbackmayhavehighoverheads

• Ifpackets1,2,3,4,6,….,100received:ACK(4,6,…,100)

• Responsetoloss:simple:

• +RetransmitthepacketforwhichACKnotreceived

• +Reorderingnotaproblem

• +Simplewindowalgorithm

• -LossofACKdoesnotnecessarilyrequiresaretransmission

• ThenextACKwilltellthatthepacketwasindeedreceived• ResilientformofindividualACKs

40

FullInformationFeedback

Page 40: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

CumulativeACK

• IndividualACKscangetlost,andrequireunnecessaryretransmission

• FullinformationfeedbackcanhandlelostACKsbuthashighoverheads

• CumulativeACKs:asweetspotbetweenthetwo

• Justthefirstpartoffullinformationfeedback

• ACKthehighestsequencenumberforallpreviouslyreceivedpackets

• Implementationsoftensendback“nextexpectedpacket”,butthat’sjustadetail

41

Page 41: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

CumulativeACKs(sameexample;saypacket5lost)

42

Fullinformationfeedback:

• StreamofACKswillbe

• Upto1• Upto2• Upto3• Upto4• Upto4,plus6• Upto4,plus6,7• Upto4,plus6,7,8• …

CumulativeACKs:

• StreamofACKswillbe

• Upto1• Upto2• Upto3• Upto4• Upto4• Upto4• Upto4• …

Tells“some”packetarrived,andwhichpacketdidnot

Tells“which”packetarrived,andwhichpacketdidnot

Page 42: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

CumulativeACK

• IndividualACKscangetlost,andrequireunnecessaryretransmission

• FullinformationfeedbackcanhandlelostACKsbuthashighoverheads

• CumulativeACKs:asweetspotbetweenthetwo

• Justthefirstpartoffullinformationfeedback

• ACKthehighestsequencenumberforallpreviouslyreceivedpackets

• Implementationsoftensendback“nextexpectedpacket”,butthat’sjustadetail

• Strengths?• ResilienttolostACKs

• Weaknesses?

• Confusedbyreordering• Incompleteinformationaboutwhichpacketshavearrived

43

Page 43: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

DetectingLoss

• Ifpackettimesout,assumeitislost…

• Howelsecanyoudetectloss?

44

Page 44: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

LossWithIndividualACKs

• Assumethatpacket5islost,butnoothers

• StreamofACKswillbe

• 1• 2• 3• 4• 6• 7• 8• …

45

Page 45: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

LossWithIndividualACKs

• Couldresendpacketwhenk“subsequentpackets”arereceived

• Responsetoloss• Resendmissingpacket

• Continuewindowbasedprotocol

46

Page 46: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

LossWithFullInformation

• Samestory,exceptthatthe“hole”isexplicitineachACK

• StreamofACKswillbe

• Upto1• Upto2• Upto3• Upto4• Upto4,plus6• Upto4,plus6,7• Upto4,plus6,7,8• …

47

Page 47: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

LossWithFullInformation

• Couldresendpacketwhenk“subsequentpackets”arereceived

• Responsetoloss• Resendmissingpacket

• Continuewindow-basedprotocol

48

Page 48: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

LossWithCumulativeACKs

• Assumepacket5islost,butnoothers

• StreamofACKswillbe

• 1• 2• 3• 4• 4(Sentwhenpacket6arrives)• 4(Sentwhenpacket7arrives)• 4(Sentwhenpacket8arrives)• …

49

Page 49: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

LossWithCumulativeACKs(cont’d)

• DuplicateACKsareasignofloss• ThelackofACKprogressmeans5hasn’tbeendelivered

• StreamofduplicateACKsmeanssomepacketsarebeingdelivered(oneforeachsubsequentpacket)

• Responsetolossistrickier…Whenshallthesourceretransmitpacket5?

• Packetmaybedelayed(so,sourceshouldwait)

• Packetmaybereordered(so,sourceshouldwait)

• Or,packetmaybedropped(sourceshouldimmediatelyretransmit)

• Impossibletoknowwhichoneisthecase

• Lifelesson:beoptimistic!

• Untiloptimismstartshurting

• Solution:retransmitafterkduplicateACKs

• forsomevalueofk,dependingonhowoptimisticyoufeel!

50

Page 50: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

CumulativeACKs(howisreorderinghandled;largek)

51

Receiverevents:

• Packet1received• Packet2received• Packet3received• Packet4received• Packet6received• Packet7received• Packet5received• Packet8received• …

CumulativeACKs:

• Upto1• Upto2• Upto3• Upto4• Upto4• Upto4• Upto7• Upto8• …

CumulativeACKsnaturallyhandlepacketreordering(Packetdelaysaresimilartoreordering)

Page 51: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

LossWithCumulativeACKs(cont’d2)

• Twochoices• Sendmissingpacketandoptimisticallyassumethatsubsequentpacketshavearrived

• i.e.,increaseWbythenumberofduplicateACKs

• Sendmissingpacket,waitforACK

• Timeout-detectedlossesalsoproblematic

• Ifpacket5timesout,packet6isabouttotimeoutalso

• Doyouresendboth?• Doyouresend5andwait?• …

52

Page 52: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

• ProduceduplicateACKs• CouldbeconfusedforlosswithcumulativeACKs

• Butduplicationisrare…

53

Receiverevents:

• Packet1received• Packet2received• -• Packet4received• Packet5received• Packet6received• Packet3received• Packet3received• Packet7received• …

CumulativeACKs:

• Upto1• Upto2• -• Upto2• Upto2• Upto2• Upto6• Upto6• Upto7• …

Sourceevents:

• Packet1sent• Packet2sent• Packet3sent• Packet4sent• Packet5sent• Packet6sent• Packet3resent• Packet7sent• …

CumulativeACKs(confusionwithduplication)

Page 53: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

CumulativeACKs

• Theymakenosense,exceptasacheapalternativetofullinformation

• Lessstatethanfullinformation

• MoreresilientthanindividualACKs

• Butambiguityinfeedbackleadstomanyproblems

• Haveotherpacketsarrived?

• Makesretransmissionandcongestionwindowmanagementhard

• WilldealwiththeseissueswhenwecometoTCP

54

Page 54: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

AllTheBadThingsBestEffortCanDo

• Packetscanbelost

• Packetscanbecorrupted

• Packetscanbereordered

• Packetscanbedelayed

• Packetscanbeduplicated

55

Page 55: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

EffectofReordering?

• Foralldesignsthislookslike“subsequentACKs”

• Thiscanbemistakenforpacketloss

• Hardtorealizethedifferencebetweenthesepacketarrivalpatterns:• 1,2,3,4,6,7,8,9,…• 1,2,3,4,6,7,8,9,5,10,…

56

Page 56: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

EffectofLongDelays?

• Possibletimeouts(foralldesigns)

57

Page 57: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

EffectofDuplication

• ProduceduplicateACKs• CouldbeconfusedforlosswithcumulativeACKs

• Butduplicationisrare…

58

Page 58: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

PossibleDesignForReliableTransport

• FullinformationACKs

• Windowbased,withretransmissionsafter

• Timeout

• KsubsequentACKs

• Thisiscorrect,high-performantandhigh-utilization

• Howaboutfairness?

59

Page 59: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

Fairness?(Comebacktolater)

• AdjustWbasedonlosses…

• Inawaythatflowsreceivesameshares

• Shortversion:• Loss:cutWby2

• Successfulreceiptofwindow:Wincreasedby1

60

Page 60: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

OverviewofReliableTransport

• Windowbasedselfcontrolseparateconcerns

• SizeofW

• Natureoffeedback• Responsetoloss

• Candesigneachaspectrelativelyindependently

• Canbecorrect,fair,high-performantandhigh-utilization

61

Page 61: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

ManyImplementationChoices

• Feedbackfromreceiver:ACKsvsNACKs

• CanNACKsaloneachievecorrectness• CanACKsaloneachievecorrectness

• VariationsonACKs• Fullinformation

• Individualpackets• Cumulative(TCP)

• Whentoresend

• Timeout

• DuplicateACKs• NACKs

62

Page 62: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

ImplementationChoices

• Theseimplementationchoicesaffect:

• Performance

• Utilization• Fairness• ..

• Theseareimportantconcerns

• Butcorrectnessismorefundamental

• Designmuststartwithcorrectness

• Canthen“engineer”itsperformancewithvarioushacks

• Thesehackscanbe“fun”,butdon’tletthemdistractyou

63

Page 63: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

WhatHaveWeDonesofar?

• Startedfromfirstprinciples

• Correctnessconditionforreliabletransport

• …tounderstandingwhyfeedbackfromreceiverisnecessary(sol-v1)

• …tounderstandingwhytimersmaybeneeded(sol-v2)

• …tounderstandingwhywindow-baseddesignmaybeneeded(sol-v3)

• …toradicallydifferentmanypossibledesignchoices

• SomeofthemclosetomodernTCP

• YouarenowreadytolearnTCP

64

Page 64: lecture20-reliable-transport-covid · 2020-04-21 · Goal of Today’s Lecture • Understanding reliable transport conceptually • What are the fundamental aspects of reliable transport

Wetriedtounderstand:

WhyisTCPdesignedthewayitisdesigned!

Whyisalmostalwaysthemostimportantquestion!!!

65