![Page 1: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/1.jpg)
OperatingSystemsandNetworks
NetworkLecture4:LinkLayer(2)
AdrianPerrigNetworkSecurityGroupETHZürich
![Page 2: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/2.jpg)
2
PendingIssues• Howtoreadthecoursetextbook?• Howtopreparefortheexamgiventhatthereisahugeamountofmaterial?
![Page 3: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/3.jpg)
3
WhereweareintheCourse• FinishingofftheLinkLayer!
– Buildsonthephysicallayertotransfer framesoverconnectedlinks
PhysicalLink
NetworkTransportApplication
![Page 4: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/4.jpg)
4
Topics1. Framing
– Delimitingstart/endofframes
2. Errordetection/correction– Handlingerrors
Done
DSL
![Page 5: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/5.jpg)
5
Topics(2)3. Retransmissions
– Handlingloss
4. MultipleAccess– ClassicEthernet,802.11
5. Switching– ModernEthernet
![Page 6: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/6.jpg)
6
Retransmissions(ARQ)(§3.3)• Twostrategiestohandleerrors:1. Detecterrorsandretransmitframe(AutomaticRepeatreQuest,
ARQ)
2. Correcterrorswithanerrorcorrectingcode
Donethis
![Page 7: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/7.jpg)
7
ContextonReliability• Whereinthestackshouldweplacereliabilityfunctions?
PhysicalLink
NetworkTransportApplication
![Page 8: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/8.jpg)
8
ContextonReliability(2)• Everywhere!Itisakeyissue
– Different layerscontributedifferently
PhysicalLink
NetworkTransportApplication
Recoveractions(correctness)
Maskerrors(performanceoptimization)
![Page 9: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/9.jpg)
9
ARQ(AutomaticRepeatreQuest)• ARQoftenusedwhenerrorsarecommonormustbecorrected– E.g.,WiFi,andTCP(later)
• Rulesatsenderandreceiver:– Receiverautomaticallyacknowledges correct frameswithanACK
– Senderautomaticallyresendsafteratimeout,untilanACKisreceived
![Page 10: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/10.jpg)
10
ARQ(2)• Normaloperation(noloss,noerror)
Frame
ACKTimeout Time
Sender Receiver
![Page 11: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/11.jpg)
11
ARQ(3)• Lossandretransmission
Frame
Timeout Time
Sender Receiver
Frame
ACK
X
![Page 12: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/12.jpg)
12
SoWhat’sTrickyAboutARQ?• Twonon-trivialissues:
– Howlongtosetthetimeout?– Howtoavoidacceptingduplicate framesasnewframes
• Wantperformanceinthecommoncaseandcorrectnessalways
![Page 13: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/13.jpg)
13
Timeouts• Timeoutshouldbe:
– Nottoobig(linkgoesidle)– Nottoosmall(spuriousresend)
• FairlyeasyonaLAN– Clearworstcase,littlevariation
• FairlydifficultovertheInternet– Muchvariation,noobviousbound– We’llrevisitthiswithTCP(later)
![Page 14: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/14.jpg)
14
Duplicates• WhathappensifanACKislost?
Frame
ACK
X
Frame
ACKTimeout
Sender Receiver
NewFrame??
![Page 15: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/15.jpg)
15
Duplicates(2)• Orthetimeoutisearly?
Frame
ACK
Frame
ACK
Timeout
Sender Receiver
NewFrame??
![Page 16: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/16.jpg)
16
SequenceNumbers• FramesandACKsmustbothcarrysequencenumbersforcorrectness
• Todistinguishthecurrentframefromthenextone,asinglebit(twonumbers)issufficient– CalledStop-and-Wait
![Page 17: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/17.jpg)
17
Stop-and-Wait• Inthenormalcase:
Time
Sender Receiver
![Page 18: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/18.jpg)
18
Stop-and-Wait(2)• Inthenormalcase:
Frame0
ACK0Timeout Time
Sender Receiver
Frame1
ACK1
![Page 19: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/19.jpg)
19
Stop-and-Wait(3)• WithACKloss:
Frame0
ACK0
X
Frame0
ACK0Timeout
Sender Receiver
It’saResend!
![Page 20: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/20.jpg)
20
Stop-and-Wait(4)• Withearlytimeout:
Frame0
ACK0
Frame0
ACK0
Timeout
Sender Receiver
It’saResend
OK…
![Page 21: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/21.jpg)
21
LimitationofStop-and-Wait• Itallowsonlyasingleframetobeoutstandingfromthesender:– GoodforLAN,inefficient forhighBD(bandwidth-delay product)
• Ex:R=1Mbps,D=50ms– Howmanyframes/sec? IfR=10Mbps?
![Page 22: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/22.jpg)
22
SlidingWindow• Generalizationofstop-and-wait
– AllowsWframestobeoutstanding– CansendWframesperRTT (=2D)
– Variousoptionsfornumbering frames/ACKsandhandlingloss• WilllookatalongwithTCP(later)
![Page 23: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/23.jpg)
Multiplexing(§2.5.3,2.5.4)• Multiplexingisthenetworkwordforthesharingofaresource
• Classicscenarioissharingalinkamongdifferentusers– TimeDivisionMultiplexing(TDM)– FrequencyDivisionMultiplexing(FDM)
23
![Page 24: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/24.jpg)
TimeDivisionMultiplexing(TDM)
• Userstaketurnsonafixedschedule
24
2 2 2 2
![Page 25: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/25.jpg)
FrequencyDivisionMultiplexing (FDM)• Putdifferentusersondifferentfrequencybands
25
Overall FDMchannel
![Page 26: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/26.jpg)
26
TDMversusFDM• InTDMausersendsatahighrateafractionofthetime;inFDM,ausersendsatalowrateallthetime
Rate
TimeFDM
TDM
![Page 27: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/27.jpg)
27
TDM/FDMUsage• Staticallydividearesource
– Suitedforcontinuous traffic,fixednumberofusers
• Widelyusedintelecommunications– TVandradiostations(FDM)– GSM(2Gcellular)allocatescallsusingTDMwithinFDM
![Page 28: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/28.jpg)
28
MultiplexingNetworkTraffic• Networktrafficisbursty
– ON/OFF sources– Loadvariesgreatlyovertime
Rate
TimeRate
Time
![Page 29: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/29.jpg)
29
MultiplexingNetworkTraffic(2)• Networktrafficisbursty
– Inefficient toalwaysallocateusertheirON needswithTDM/FDM
Rate
TimeRate
Time
R
R
![Page 30: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/30.jpg)
MultiplexingNetworkTraffic(3)• Multipleaccessschemesmultiplexusersaccordingtotheirdemands– forgainsofstatisticalmultiplexing
30
Rate
TimeRate
Time
Rate
Time
R
R
R’<2R
Twousers,eachneedR TogethertheyneedR’<2R
![Page 31: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/31.jpg)
31
MultipleAccess• Wewilllookattwokindsofmultipleaccessprotocols1. Randomized.Nodesrandomize their resourceaccessattempts
– Goodforlowloadsituations
2. Contention-free. Nodesordertheirresourceaccessattempts– Goodforhighloadorguaranteedqualityofservicesituations
![Page 32: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/32.jpg)
32
RandomizedMultipleAccess(§4.2.1-4.2.2,4.3.1-4.3.3)
• Howdonodesshareasinglelink?Whosendswhen,e.g.,inWiFI?– Explorewithasimplemodel
• Assumeno-oneisincharge;thisisadistributedsystem
![Page 33: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/33.jpg)
33
RandomizedMultipleAccess(2)• Wewillexplorerandommultipleaccesscontrol ormediumaccesscontrol (MAC)protocols– ThisisthebasisforclassicEthernet– Remember:datatraffic isbursty
Zzzz..Busy! Hohum
![Page 34: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/34.jpg)
34
ALOHANetwork• SeminalcomputernetworkconnectingtheHawaiianislandsinthelate1960s– Whenshouldnodessend?– A newprotocolwasdevisedbyNormAbramson…
Hawaii
![Page 35: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/35.jpg)
35
ALOHAProtocol• Simpleidea:
– Nodejustsendswhenithastraffic.– Iftherewasacollision(noACKreceived) thenwaitarandomtimeandresend
• That’sit!
![Page 36: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/36.jpg)
36
ALOHAProtocol(2)• Someframeswillbelost,butmanymaygetthrough…
• Goodidea?
![Page 37: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/37.jpg)
37
ALOHAProtocol(3)• Simple,decentralizedprotocolthatworkswellunderlowload!
• Notefficientunderhighload– Analysisshowsatmost18%efficiency– Improvement:divide timeintoslotsandefficiency goesupto36%
• We’lllookatotherimprovements
![Page 38: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/38.jpg)
38
ClassicEthernet• ALOHAinspiredBobMetcalfetoinventEthernetforLANsin1973– Nodesshare10Mbpscoaxialcable– Hugelypopular in1980s,1990s
:©2009IEEE
![Page 39: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/39.jpg)
39
CSMA(CarrierSenseMultipleAccess)
• ImproveALOHAbylisteningforactivitybeforewesend(Doh!)– Candoeasilywithwires,notwireless
• Sodoesthiseliminatecollisions?– Whyorwhynot?
![Page 40: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/40.jpg)
40
CSMA(2)• Stillpossibletolistenandhearnothingwhenanothernodeissendingbecauseofdelay
![Page 41: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/41.jpg)
41
CSMA/CD(withCollisionDetection)• Canreducethecostofcollisionsbydetectingthemandaborting(Jam)therestoftheframetime– Again,wecandothiswithwires
XX X X X X X XJam! Jam!
![Page 42: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/42.jpg)
42
CSMA/CDComplications• Wanteveryonewhocollidestoknowthatithappened
– Timewindow inwhichanodemayhearofacollisionis2Dseconds
X
![Page 43: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/43.jpg)
43
CSMA/CDComplications(2)• Imposeaminimumframesizethatlastsfor2D seconds
– Sonodecan’tfinishbeforecollision– Ethernetminimumframeis64bytes
X
![Page 44: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/44.jpg)
44
CSMA“Persistence”• Whatshouldanodedoifanothernodeissending?
• Idea:Waituntilitisdone,andsend
Whatnow?
![Page 45: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/45.jpg)
45
CSMA“Persistence”(2)• Problemisthatmultiplewaitingnodeswillqueueupthencollide– Moreload,moreofaproblem
Now! Now!Uhoh
![Page 46: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/46.jpg)
46
CSMA“Persistence”(3)• Intuitionforabettersolution
– IfthereareNqueuedsenders,wewanteachtosendnextwithprobability1/N
Sendp=½WhewSendp=½
![Page 47: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/47.jpg)
47
BinaryExponentialBackoff(BEB)• Cleverlyestimatestheprobability
– 1stcollision,wait0or1frametimes– 2ndcollision,waitfrom0to3times– 3rdcollision,waitfrom0to7times…
• BEBdoublesintervalforeachsuccessivecollision– Quicklygetslargeenoughtowork– Veryefficient inpractice
![Page 48: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/48.jpg)
ClassicEthernet,orIEEE802.3• MostpopularLANofthe1980s,1990s
– 10Mbpsoversharedcoaxialcable,withbasebandsignals– Multipleaccesswith“1-persistentCSMA/CDwithBEB”– Withreasonableparameters,85%efficiency (Book4.3.3)
48
![Page 49: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/49.jpg)
EthernetFrameFormat• Hasaddressestoidentifythesenderandreceiver• CRC-32forerrordetection;noACKsorretransmission• Startofframeidentifiedwithphysicallayerpreamble
49
PacketfromNetworklayer(IP)
![Page 50: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/50.jpg)
50
ModernEthernet• Basedonswitches,notmultipleaccess,butstillcalledEthernet– We’llgettoitlater
Switch
TwistedpairSwitchports
![Page 51: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/51.jpg)
51
WirelessMultipleAccess(§4.2.5,4.4)• Howdowirelessnodesshareasinglelink?(Yes,thisisWiFi!)– Buildonoursimple,wiredmodel
Send? Send?
![Page 52: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/52.jpg)
52
WirelessComplications• Wirelessismorecomplicatedthanthewiredcase(Surprise!)1. Nodesmayhavedifferentareasofcoverage– doesn’tfit
CarrierSense2. Nodescan’thearwhilesending– can’tCollisionDetect
≠CSMA/CD
![Page 53: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/53.jpg)
53
DifferentCoverageAreas• Wirelesssignalisbroadcastandreceivednearby,wherethereissufficientSNR
![Page 54: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/54.jpg)
HiddenTerminals• NodesAandCarehiddenterminals whensendingtoB
– Can’theareachother(tocoordinate)yetcollideatB– Wewanttoavoidtheinefficiency ofcollisions
54
![Page 55: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/55.jpg)
ExposedTerminals• BandCareexposedterminals whensendingtoAandD
– Canheareachotheryetdon’tcollideatreceiversAandD– Wewanttosendconcurrently toincreaseperformance
55
![Page 56: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/56.jpg)
56
NodesCan’tHearWhileSending• Withwires,detectingcollisions(andaborting)lowerstheircost
• Morewastedtimewithwireless
Time XXXXXXXXX
XXXXXXXXX
WirelessCollision
ResendX
X
WiredCollision
Resend
![Page 57: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/57.jpg)
PossibleSolution:MACA• MACAusesashorthandshakeinsteadofCSMA(Karn,1990)
– 802.11usesarefinementofMACA(later)
• Protocolrules:1. AsendernodetransmitsaRTS(Request-To-Send,withframelength)2. ThereceiverreplieswithaCTS(Clear-To-Send,withframelength)3. SendertransmitstheframewhilenodeshearingtheCTSstaysilent– CollisionsontheRTS/CTSarestillpossible,butlesslikely
57
![Page 58: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/58.jpg)
58
MACA– HiddenTerminals• AàBwithhiddenterminalC
1. AsendsRTS,toB
DCBA
![Page 59: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/59.jpg)
59
MACA– HiddenTerminals(2)• AàBwithhiddenterminalC
2. BsendsCTS,toA,andCtoo
DCBARTS
![Page 60: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/60.jpg)
60
MACA– HiddenTerminals(3)• AàBwithhiddenterminalC
2. BsendsCTS,toA,andCtoo
DCBARTS
CTSCTS
Alert!
![Page 61: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/61.jpg)
61
MACA– HiddenTerminals(4)• AàBwithhiddenterminalC
3. AsendsframewhileCdefers
FrameQuiet...
![Page 62: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/62.jpg)
62
MACA– ExposedTerminals• BàA,CàDasexposedterminals– BandCsendRTStoAandD
DCBA
![Page 63: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/63.jpg)
63
MACA– ExposedTerminals(2)• BàA,CàDasexposedterminals– AandDsendCTStoBandC
DCBARTSRTS
![Page 64: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/64.jpg)
64
MACA– ExposedTerminals(3)• BàA,CàDasexposedterminals– AandDsendCTStoBandC
DCBARTSRTS
CTSCTS
AllOKAllOK
![Page 65: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/65.jpg)
65
MACA– ExposedTerminals(4)• BàA,CàDasexposedterminals– AandDsendCTStoBandC
DCBAFrameFrame
![Page 66: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/66.jpg)
66
802.11,orWiFi• VerypopularwirelessLAN
startedinthe1990s• Clientsgetconnectivity froma
(wired)AP(AccessPoint)• It’samulti-accessproblemJ• Variousflavorshavebeen
developed overtime– Faster,morefeatures
AccessPoint
Client
ToNetwork
![Page 67: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/67.jpg)
67
802.11PhysicalLayer• Uses20/40MHzchannelsonISMbands
– 802.11b/g/non2.4GHz– 802.11a/non5GHz
• OFDMmodulation (except legacy802.11b)– Differentamplitudes/phasesforvaryingSNRs– Ratesfrom6to54Mbpspluserrorcorrection– 802.11nusesmultipleantennas;see“802.11withMultipleAntennasfor
Dummies”
![Page 68: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/68.jpg)
802.11LinkLayer• MultipleaccessusesCSMA/CA(next);RTS/CTSoptional• FramesareACKed andretransmittedwithARQ• Funkyaddressing(threeaddresses!)duetoAP• Errorsaredetectedwitha32-bitCRC• Many,manyfeatures(e.g.,encryption,powersave)
68
PacketfromNetworklayer(IP)
![Page 69: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/69.jpg)
802.11CSMA/CAforMultipleAccess• Senderavoidscollisionsbyinsertingsmallrandomgaps
– E.g.,whenbothBandCsend,Cpicksasmallergap,goesfirst
69
Time
Send?
Send?
![Page 70: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/70.jpg)
TheFutureof802.11(Guess)• LikelyubiquitousforInternetconnectivity– Greaterdiversity,fromlow- tohigh-enddevices
• Innovationinphysical layerdrivesspeed– Andpower-efficientoperationtoo
• Moreseamlessintegrationofconnectivity– Toomanualnow,andlimited(e.g.,device-to-device)
70
![Page 71: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/71.jpg)
71
Contention-FreeMultipleAccess(§4.2.3)• Anotherapproachtomultipleaccess
– Basedonturns,notrandomization
1
32
4
![Page 72: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/72.jpg)
72
IssueswithRandomMultipleAccess• CSMAisgoodunderlowload:– Grantsimmediateaccess– Littleoverhead(fewcollisions)
• Butnotsogoodunderhighload:– Highoverhead(expectcollisions)– Accesstimevaries(lucky/unlucky)
• Wewanttodobetterunderload!
![Page 73: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/73.jpg)
73
Turn-TakingMultipleAccessProtocols
• Theydefineanorderinwhichnodesgetachancetosend– Orpass,ifnotrafficatpresent
• Wejustneedsomeordering…– E.g.,TokenRing– E.g.,nodeaddresses
![Page 74: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/74.jpg)
TokenRing• Arrangenodesinaring;tokenrotates“permissiontosend”toeachnodeinturn
74
Node
Directionoftransmission
Token
![Page 75: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/75.jpg)
75
Turn-TakingAdvantages• Fixedoverheadwithnocollisions–Moreefficientunderload
• Regularchancetosendwithnounluckynodes– Predictableservice,easilyextendedtoguaranteedqualityofservice
![Page 76: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/76.jpg)
76
Turn-TakingDisadvantages• Complexity–Morethingsthatcangowrongthanrandomaccessprotocols!• E.g.,whatifthetokenislost?• Electaleaderwhomanagesthetoken,whattodoifleadercrashes?
– Higheroverheadatlowload
![Page 77: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/77.jpg)
77
Turn-TakinginPractice• Regularlytriedasanimprovementofferingbetterservice– E.g.,qualitiesofservice
• Butrandommultipleaccessishardtobeat– Simple,andusuallygoodenough– Scalesfromfewtomanynodes
![Page 78: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/78.jpg)
78
LANSwitches(§4.3.4,4.8.1-4.8.2,4.8.4)• Howdoweconnectnodeswithaswitch insteadofmultipleaccess– Usesmultiplelinks/wires– Basisofmodern(switched)Ethernet
Switch
![Page 79: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/79.jpg)
79
SwitchedEthernet• HostsarewiredtoEthernetswitcheswithtwistedpair
– Switchservestoconnect thehosts– Wiresusuallyruntoacloset
Switch
TwistedpairSwitchports
![Page 80: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/80.jpg)
80
What’sinthebox?• Rememberfromprotocollayers:
Network
LinkNetwork
Link
Link Link
Physical PhysicalHub,orrepeater
Switch
Router
Alllooklikethis:
![Page 81: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/81.jpg)
InsideaHub• Allportsarewiredtogether;moreconvenientandreliablethanasinglesharedwire
81
↔
![Page 82: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/82.jpg)
InsideaSwitch• Usesframeaddressestoconnectinputporttotherightoutputport;multipleframesmaybeswitchedinparallel
82
...
Fabric
![Page 83: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/83.jpg)
InsideaSwitch(2)• Portmaybeusedforbothinputandoutput(full-duplex)
– Justsend,nomultipleaccessprotocol
83
...
123
4
1à 4and2à 3
![Page 84: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/84.jpg)
InsideaSwitch(3)• Needbuffersformultipleinputstosendtooneoutput
84
...
...
... ...
InputBuffer OutputBufferFabric
Input Output
![Page 85: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/85.jpg)
InsideaSwitch(4)• Sustainedoverloadwillfillbufferandleadtoframeloss
85
...
...
... ...
InputBuffer OutputBufferFabric
Input Output
XXX
Loss!
![Page 86: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/86.jpg)
86
AdvantagesofSwitches• Switchesandhubshavereplacedthesharedcableofclassic
Ethernet– Convenienttorunwirestoonelocation– Morereliable;wirecutisnotasinglepointoffailurethatishardto
find
• Switchesofferscalableperformance– E.g.,100Mbpsperportinsteadof100Mbpsforallnodesofshared
cable/hub
![Page 87: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/87.jpg)
SwitchForwarding• SwitchneedstofindtherightoutputportforthedestinationaddressintheEthernetframe.How?– Wanttolethostsbemovedaroundreadily;don’tlookatIP
87
...
...
... ...
Source
Destination
EthernetFrame
![Page 88: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/88.jpg)
88
BackwardLearning• Switchforwardsframeswithaport/addresstableasfollows:1. Tofillthetable,itlooksatthesourceaddressofinput
frames2. Toforward,itsendstotheport,orelsebroadcaststo
allports
![Page 89: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/89.jpg)
89
BackwardLearning(2)• 1:AsendstoD
Switch
D
Address PortABCD
![Page 90: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/90.jpg)
90
BackwardLearning(3)• 2:DsendstoA
Switch
D
Address PortA 1BCD
![Page 91: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/91.jpg)
91
BackwardLearning(4)• 3:AsendstoD
Switch
D
Address PortA 1BCD 4
![Page 92: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/92.jpg)
92
BackwardLearning(5)• 3:AsendstoD
Switch
D
Address PortA 1BCD 4
![Page 93: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/93.jpg)
LearningwithMultipleSwitches• Justworkswithmultipleswitchesandamixofhubsassumingnoloops,e.g.,AsendstoDthenDsendstoA
93
Switch
![Page 94: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/94.jpg)
94
SwitchSpanningTree(§4.8.3)• Howcanweconnectswitchesinanytopologysotheyjustwork?
Loops– yikes!
![Page 95: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/95.jpg)
95
Problem– ForwardingLoops• Mayhavealoopinthetopology
– Redundancy incaseoffailures– Orasimplemistake
• WantLANswitchesto“justwork”– Plug-and-play,nochangestohosts– Butloopscauseaproblem…
RedundantLinks
![Page 96: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/96.jpg)
96
ForwardingLoops(2)• SupposethenetworkisstartedandAsendstoF.Whathappens?
Left/Right
A B
C
D
E F
![Page 97: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/97.jpg)
97
ForwardingLoops(3)• SupposethenetworkisstartedandAsendstoF.Whathappens?– Aà Cà B,D-left,D-right– D-leftà C-right,E,F– D-rightà C-left,E,F– C-rightà D-left,A,B– C-leftà D-right,A,B– D-leftà…– D-rightà …
Left/Right
A B
C
D
E F
![Page 98: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/98.jpg)
98
SpanningTreeSolution• Switchescollectivelyfindaspanningtreeforthetopology– Asubsetoflinksthatisatree(noloops)andreachesallswitches
– Switchesforwardasnormalbutonlyonspanningtree– Broadcastswillgouptotherootofthetreeanddownallthebranches
![Page 99: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/99.jpg)
SpanningTree(2)
99
Topology OneST AnotherST
Root
![Page 100: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/100.jpg)
100
Radia Perlman(1951–)• Keyearlyworkonroutingprotocols– RoutingintheARPANET– SpanningTreeforswitches(next)– Link-staterouting(later)
• Nowfocusedonnetworksecurity
![Page 101: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/101.jpg)
101
SpanningTreeAlgorithm• Rulesofthedistributedgame:
– Allswitchesrunthesamealgorithm– Theystartwithnoinformation– Operate inparallel andsendmessages– Alwayssearchforthebestsolution
• Ensuresahighlyrobustsolution– Anytopology,withnoconfiguration– Adaptstolink/switch failures,…
![Page 102: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/102.jpg)
102
SpanningTreeAlgorithm(2)• Outline:
1. Electarootnodeofthetree(switchwiththelowestaddress)
2. Growtreeasshortestdistancesfromtheroot(usinglowestaddresstobreakdistanceties)
3. Turnoffportsforforwardingiftheyarenotonthespanningtree
![Page 103: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/103.jpg)
SpanningTreeAlgorithm(3)• Details:
– Eachswitchinitiallybelievesitistherootofthetree– Eachswitchsendsperiodic updatestoneighborswith:
• Itsaddress,addressoftheroot,anddistance(inhops)toroot– Switchesfavorsportswithshorterdistancestolowestroot
• Useslowestaddressasatiefordistances
103
C
Hi,I’mC,therootisA,it’s2 hopsaway or(C,A,2)
![Page 104: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/104.jpg)
104
SpanningTreeExample• 1st round,sending:
– Asends(A,A,0)tosayitisroot– B,C,D,E,andFdolikewise
• 1st round,receiving:– Astillthinksisit(A,A,0)– Bstillthinks(B,B,0)– Cupdatesto(C,A,1)– Dupdatesto(D,C,1)– Eupdatesto(E,A,1)– Fupdatesto(F,B,1)
A,A,0 B,B,0
C,C,0
D,D,0
E,E,0 F,F,0
![Page 105: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/105.jpg)
105
SpanningTreeExample(2)• 2nd round,sending
– Nodessendtheirupdatedstate• 2nd roundreceiving:
– Aremains(A,A,0)– Bupdatesto(B,A,2)viaC– Cremains(C,A,1)– Dupdatesto(D,A,2)viaC– Eremains(E,A,1)– Fremains(F,B,1)
A,A,0 B,B,0
C,A,1
D,C,1
E,A,1 F,B,1
![Page 106: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/106.jpg)
106
SpanningTreeExample(3)• 3rd round,sending
– Nodessendtheirupdatedstate• 3rd roundreceiving:
– Aremains(A,A,0)– Bremains(B,A,2)viaC– Cremains(C,A,1)– Dremains(D,A,2)viaC-left– Eremains(E,A,1)– Fupdatesto(F,A,3)viaB
A,A,0 B,A,2
C,A,1
D,A,2
E,A,1 F,B,1
![Page 107: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/107.jpg)
107
SpanningTreeExample(4)• 4th round
– Steady-statehasbeenreached– Nodesturnoffforwarding thatisnotonthespanningtree
• Algorithmcontinuestorun– Adaptsbytimingoutinformation– E.g.,ifAfails,othernodesforgetit,andBwillbecomethenewroot
A,A,0 B,A,2
C,A,1
D,A,2
E,A,1 F,A,3
![Page 108: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/108.jpg)
108
SpanningTreeExample(5)• ForwardingproceedsasusualontheST• InitiallyDsendstoF:
• AndFsendsbacktoD:
A,A,0 B,A,2
C,A,1
D,A,2
E,A,1 F,A,3
![Page 109: Operating Systems and Networks Network Lecture 4: Link Layer … · 2018-01-27 · Possible Solution: MACA • MACA uses a short handshake instead of CSMA (Karn, 1990) – 802.11](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb643a408d15e7a565f13ac/html5/thumbnails/109.jpg)
109
SpanningTreeExample(6)• ForwardingproceedsasusualontheST• InitiallyDsendstoF:
– Dà C-left– Cà A,B– Aà E– Bà F
• AndFsendsbacktoD:– Fà B– Bà C– Cà D(hm,notsuchagreatroute)
A,A,0 B,A,2
C,A,1
D,A,2
E,A,1 F,A,3