Media Access Protocols Sprig 2018 CS 438 Staff, Uiversity of Illiois 1
Where are We? you are here 00010001 11001001 00011101 A midterm is here Sprig 2018 CS 438 Staff, Uiversity of Illiois 2
Multiple Access Media Multiple seders o some media Buses (Etheret) Radio, Satellite Toke Rig Need methods to mediate access Fair arbitratio Good performace Sprig 2018 CS 438 Staff, Uiversity of Illiois 3
Poit-to-Poit vs. Broadcast Media Poit-to-poit: dedicated pairwise commuicatio Log-distace fiber lik Poit-to-poit lik betwee Etheret switch ad host Broadcast: shared wire or medium Traditioal Etheret 802.11 wireless LAN Sprig 2018 CS 438 Staff, Uiversity of Illiois 4
Types of Shared Lik Networks Bus Topology: Shared Etheret, Toke Bus Rig Topology: Multihop FDDI, IEEE 802.5 Star Topology: Active or Passive Hub ATM Wireless: Shared IEEE 802.11 Sprig 2018 CS 438 Staff, Uiversity of Illiois 5
Multiple Access Algorithm Sigle shared broadcast chael Must avoid havig multiple odes speakig at oce Otherwise, collisios lead to garbled data Need distributed algorithm for sharig the chael Algorithm determies which ode ca trasmit Typical assumptios Commuicatio eeds vary Over time Betwee hosts Network is ot fully utilized Sprig 2018 CS 438 Staff, Uiversity of Illiois 6
Multiple Access Media Which kid of multiplexig is best? Chael partitioig: divide chael ito pieces Frequecy-divisio multiplexig (FDM, separate bads) Takig turs: scheme for tradig off who gets to trasmit Time-divisio multiplexig (TDM, sychroous time slots) Statistical time-divisio multiplexig (STDM, time slots o demad) Radom access: allow collisios, ad the recover Sprig 2018 CS 438 Staff, Uiversity of Illiois 7
Chael Partitioig: FDMA FDMA: Frequecy Divisio Multiple Access Chael spectrum divided ito frequecy bads Each statio assiged fixed frequecy bad Uused trasmissio time i frequecy bads go idle Example: 6-statio LAN, 1,3,4 have pkt, frequecy bads 2,5,6 idle FDM cable frequecy bads time Sprig 2018 CS 438 Staff, Uiversity of Illiois 8
Chael Partitioig: TDMA TDMA: Time Divisio Multiple Access Access to chael i "rouds" Each statio gets fixed legth slot i each roud Time-slot legth is packet trasmissio time Uused slots go idle Example: 6-statio LAN with slots 0, 3, ad 4 Rouds Slots = 0 1 2 3 4 5 0 1 2 3 4 5 Sprig 2018 CS 438 Staff, Uiversity of Illiois 9
Chael Partitioig: STDMA STDMA: Statistical Time Divisio Multiple Access Access to chael as eeded Each statio gets fixed legth o trasmissio Time-slot legth is packet trasmissio time Example Uused slots go idle oly if o statio has data to sed Slots = 0 1 2 3 4 5 6 7 8 9 10 11 Sprig 2018 CS 438 Staff, Uiversity of Illiois 10
Chael Partitioig: Takig Turs slaves data data Pollig Master ode ivites slave odes to trasmit i tur Cocers poll master Pollig overhead Latecy Sigle poit of failure (master) Toke passig Cotrol toke passed from oe ode to ext sequetially Node must have toke to sed Cocers Toke overhead Latecy At mercy of ay ode Sprig 2018 CS 438 Staff, Uiversity of Illiois 11
Multiple Access Media: Radom Access Radom access Optimize for the commo case (o collisio) Do t avoid collisios, just recover from them. Whe ode has packet to sed Trasmit at full chael data rate No a priori coordiatio amog odes Two or more trasmittig odes Þ collisio Data lost Radom access MAC protocol specifies How to detect collisios How to recover from collisios Sprig 2018 CS 438 Staff, Uiversity of Illiois 12
Multiple Access Media to Discuss Two solutios (of may) Carrier sese multiple access with collisio detectio (CSMA/CD) Sed oly if medium is idle Stop sedig immediately if collisio detected Carrier sese multiple access with collisio Avoidace (CSMA/CA) Sed oly if medium is idle Desig sed algorithm to avoid collisios Taebaum Sec. 4.2 covers may others Sprig 2018 CS 438 Staff, Uiversity of Illiois 13
Carrier Sese Multiple Access with Collisio Detectio (CSMA/CD) Used by Etheret Xerox ad IEEE 802.3 (10Mbps stadards) IEEE 802.3u (Fast Etheret, 100Mbps stadard) IEEE 802.3z,ab (1Gbps Etheret) IEEE 802.3-2005/8 (10 Gbps Etheret, o shared bus) Outlie Historical developmet Topologies ad compoets MAC algorithm Collisio detectio limitatios Lessos leared Sprig 2018 CS 438 Staff, Uiversity of Illiois 14
Aloha, Networkig! Aloha Packet Radio Network Norm Abramso left Staford to surf Set up first data commuicatio system for Hawaiia islads Hub at U. Hawaii, Oahu Two radio chaels: Radom access: for sites sedig data Broadcast for hub rebroadcastig data Sprig 2018 CS 438 Staff, Uiversity of Illiois 15
Pure ALOHA Keep it simple User trasmits at will If two or more messages overlap i time collisio Receiver caot decode packets Wait roudtrip time plus a fixed icremet collisio Lack of ACK After a collisio Collidig statios retrasmit Stagger attempts radomly to reduce repeat collisios After several attempts, seders give up Simple but wasteful Max efficiecy of at most 1/(2e) = 18%! Sprig 2018 CS 438 Staff, Uiversity of Illiois 16
From Aloha comes Etheret Etheret Developed by Xerox PARC, 1974 Stadardized by Xerox, DEC ad Itel i 1978 Later, IEEE 802.3 stadard Fast Etheret (100 Mbps) - IEEE 802.3u stadard Switched Etheret ow popular Numerous stadards with icreasig badwidth over the years 10 Mbps 100 Mbps 1 Gbps 10 Gbps Xerox Alto, first machie etworked with etheret Sprig 2018 CS 438 Staff, Uiversity of Illiois 17
Etheret - CSMA/CD CS Carrier Sese Nodes ca distiguish betwee a idle ad a busy lik MA - Multiple Access A set of odes sed ad receive frames over a shared lik CD Collisio Detectio Nodes liste durig trasmissio to determie if there has bee iterferece Sprig 2018 CS 438 Staff, Uiversity of Illiois 18
Etheret Topologies Bus Topology: Shared All odes coected to a wire Star Topology: All odes coected to a cetral repeater Sprig 2018 CS 438 Staff, Uiversity of Illiois 19
Etheret Coectivity 10Base5 ThickNet < 500m Vampire Tap Cotroller Trasceiver Bus Topology Sprig 2018 CS 438 Staff, Uiversity of Illiois 20
Etheret Coectivity 10Base2 ThiNet < 200m Trasceiver BNC T-Juctio Cotroller Bus Topology Sprig 2018 CS 438 Staff, Uiversity of Illiois 21
Etheret Coectivity 10BaseT < 100m Cotroller Star Topology Sprig 2018 CS 438 Staff, Uiversity of Illiois 22
Etheret Specificatios Coaxial Cable up to 500m Taps > 2.5m apart Trasceiver Idle detectio Seds/Receives sigal Repeater Jois multiple Etheret segmets < 5 repeaters betwee ay two hosts < 1024 hosts Sprig 2018 CS 438 Staff, Uiversity of Illiois 23
10Mb Etheret Specificatios Broadcast Ecodig Machester 10 Mbps Þ Trasmissio at 20Mhz Faster Etheret stadards use more efficiet ecodigs Framig Preamble marks begiig, setiel marks ed of frame Bit orieted (similar to HDLC) Data-depedet legth Error Detectio 32-bit CRC Sprig 2018 CS 438 Staff, Uiversity of Illiois 24
Etheret MAC Algorithm Node A Node B Node A starts trasmissio at time 0 At time almost T, ode A s message has almost arrived Ä Node B starts trasmissio at time T How ca we esure that A kows about the collisio? Sprig 2018 CS 438 Staff, Uiversity of Illiois 25
Collisio Detectio Problem How ca A detect a collisio? Solutio A must still be trasmittig whe it receives B s trasmissio! Example Node A s message reaches ode B at time T Node B s message reaches ode A at time 2T For ode A to detect a collisio, ode A must still be trasmittig at time 2T Sprig 2018 CS 438 Staff, Uiversity of Illiois 26
Etheret MAC Algorithm Node A Node B Ä At time almost T, ode A s message has almost arrived Node A starts trasmissio at time 0 Node B starts trasmissio at time T At time 2T, A is still trasmittig ad otices a collisio Sprig 2018 CS 438 Staff, Uiversity of Illiois 27
Collisio Detectio IEEE 802.3 2T is bouded to 51.2µs At 10Mbps 51.2µs = 512b or 64 = 512b or 64B Packet legth ³ 64B Jam after collisio Esures that all hosts otice the collisio Sprig 2018 CS 438 Staff, Uiversity of Illiois 28
Etheret MAC Algorithm Seder/Trasmitter If lie is idle (carrier sesed) Sed immediately Sed maximum of 1500B data (1527B total) Wait 9.6 µs before sedig agai If lie is busy (o carrier sese) Wait util lie becomes idle Sed immediately (1-persistet) If collisio detected Stop sedig ad jam sigal Try agai later Why have a max size? Wat to prevet oe ode from takig over completely Why 9.6 µs? Too log: wastes time Too short: does't allow other odes to trasmit (fairess) How do we do this? How do we do this? Sprig 2018 CS 438 Staff, Uiversity of Illiois 29
Collisio Detectio Techiques: Bus Topology Trasceiver hadles Carrier detectio Collisio detectio Jammig after collisio Trasceiver sees sum of voltages Outgoig sigal Icomig sigal Trasceiver looks for Voltages impossible for oly outgoig Trasceivers Sprig 2018 CS 438 Staff, Uiversity of Illiois 30
Collisio Detectio Techiques: Hub Topology Cotroller/Card hadles Carrier detectio Hub hadles Collisio detectio Jammig after collisio Need to detect activity o all lies If more tha oe lie is active Assert collisio to all lies Cotiue util o lies are active Sprig 2018 CS 438 Staff, Uiversity of Illiois 31
Frame Receptio Seder hadles all access cotrol Receiver simply pulls the frame from the etwork Etheret cotroller/card Sees all frames Selectively passes frames to host processor Acceptable frames Addressed to host Addressed to broadcast Addressed to multicast address to which host belogs Aythig (if i promiscuous mode) Need this for packet siffers/tcpdump Sprig 2018 CS 438 Staff, Uiversity of Illiois 32
Retrasmissio How log should a host wait to retry after a collisio? What happes if the host waits too log? Wasted badwidth What happes if the host does t wait log eough? More collisios Etheret Solutio Biary expoetial backoff Maximum backoff doubles with each failure After N failures, pick a N-bit umber Sprig 2018 CS 438 Staff, Uiversity of Illiois 33 2 N discrete possibilities from 0 to maximum
Biary Expoetial Backoff Choices after 2 collisios Choices after 1 collisio 0 Ts 2Ts 3Ts Time of collisio Why use fixed time slots? How log should the slots be? Sprig 2018 CS 438 Staff, Uiversity of Illiois 34
Biary Expoetial Backoff For IEEE 802.3, T = 51.2 µs Cosider the followig k hosts collide Each picks a radom umber from 0 to 2 (N-1) If the miimum value is uique All other hosts see a busy lie Note: Etheret RTT < 51.2 µs If the miimum value is ot uique Hosts with miimum value slot collide agai! Next slot is idle Cosider the ext smallest backoff value Sprig 2018 CS 438 Staff, Uiversity of Illiois 35
Biary Expoetial backoff algorithm Whe collisio first occurs Sed a jammig sigal to prevet further data beig set Resed a frame After either 0 or T secods, chose at radom If resed fails, resed the frame agai After either 0, T, 2T, or 3T secods. I other words, sed after kt secods, where k is a radom iteger with 0 k < 2 2 If that still does't work, resed the frame agai After kt, where k is a radom umber with 0 k < 2 3 I geeral, after the th failed attempt, resed the frame after kt, where k is a radom umber ad 0 k < 2 Sprig 2018 CS 438 Staff, Uiversity of Illiois 36
10 Mbps Etheret Example Two odes are ready to sed a packet at the same time a third eds trasmissio i th roud Each odes wait [0, 1,, 2 (i 1) 1] slots util ext attempt 1 st roud choices: 0 2 d roud choices: 0, 1 3 rd roud choices: 0, 1, 2, 3 All 2 i-1 choices have equal probability q i = P[collisio i the i th roud] Assumig collisios i all the previous i 1 rouds Sprig 2018 CS 438 Staff, Uiversity of Illiois 37
10 Mbps Etheret Example Fid q i as a fuctio of i for all i 1 There are 2 (i-1) slots to chose from Statio A selects a slot with probability 1/2 (i-1) Statio B selects a slot with probability 1/2 (i-1) Ad the same slot is chose with probability 1/2 (i-1) This probability does t deped o the slot the first statio selected, so the ucoditioal probability is q i = 2 (i 1) Sprig 2018 CS 438 Staff, Uiversity of Illiois 38
10 Mbps Etheret Example Fid the probability p i that exactly i rouds are eeded for the first success p i = q 1 q 2 q 3 q i-1 (1 q i ) Compute p 1, p 2, p 3, p 4 ad p 5 p 1 = 1 q 1 = 0 p 2 = q 1 (1 q 2 ) = 1 (1 ½) p 3 = q 1 q 2 (1 q 3 ) = 1 ½ (1 ¼) p 4 = q 1 q 2 q 3 (1 q 4 ) = 1 ½ ¼ (1 1/8) p 5 = q 1 q 2 q 3 q 4 (1 q 5 ) = 1 ½ ¼ 1/8 (1 1/16) Sprig 2018 CS 438 Staff, Uiversity of Illiois 39
10 Mbps Etheret Example Give a upper boud o the probability it takes more that 20 ms util the first success Slot duratio is 51.2μs 20 ms = 390 slots Maximum probability smallest umber of collisios Both statios must wait maximum amout of time Delay for eight collisios = 1 + 2+ 4 + 8 + 16 + 32 + 64 + 128 = 255 Delay for ie collisios = 1 + 2+ 4 + 8 + 16 + 32 + 64 + 128 + 256 = 511 Sprig 2018 CS 438 Staff, Uiversity of Illiois 40
10 Mbps Etheret Example Give a upper boud o the probability it takes more that 20 ms util the first success At least 8 collisios delay >= 20 ms P(delay >= 20 ms) = q 1 q 2 q 3 q 4 q 5 q 6 q 7 q 8 = 2 (0+1+2+3+4+5+6+7) Sprig 2018 CS 438 Staff, Uiversity of Illiois 41
10Mbps Etheret Media Name Cable Advatages Max. Segmet Legth Max Nodes o Segmet 10Base5 Thick Coaxial (10mm) Good for backboes 500m 100 10Base2 Thi Coaxial (5mm) Cheapest system 200m 30 10BaseT Twisted Pair (0.5mm) Easy Maiteace 100m 1 (to hub) 10BaseFP Fiber (0.1mm) Best betwee buildigs 500m 33 Exteded segmets may have up to 4 repeaters (total of 2.5km) Sprig 2018 CS 438 Staff, Uiversity of Illiois 42
10Mbps Etheret Media Name Cable Advatages Max. Segmet Legth 10Base5 10Base2 10BaseT 10BaseFP Thick Coaxial (10mm) Thi Coaxial Good for backboes The fixed T defies (5mm) the maximum segmet legth Twisted Pair (0.5mm) Fiber (0.1mm) Cheapest system Easy Maiteace Best betwee buildigs Max Nodes o Segmet 500m 100 200m 30 100m 1 (to hub) 500m 33 Exteded segmets may have up to 4 repeaters (total of 2.5km) Sprig 2018 CS 438 Staff, Uiversity of Illiois 43
100Mbps Etheret Media Name Cable Max. Segmet Legth Advatages 100BaseT4 4 Twisted Pair 100m Cat 3, 4 or 5 UTP 100BaseTX Twisted Pair 100m Full duplex o Cat 5 UTP 100BaseFX Fiber Pair 100m Full duplex, log rus All hub based. Other types ot allowed. Hubs ca be shared or switched Sprig 2018 CS 438 Staff, Uiversity of Illiois 44
100Mbps Etheret Media Name Cable Max. Segmet Legth Advatages 100BaseT4 4 Twisted Pair 100m Cat 3, 4 or 5 UTP Shorter distaces, 100BaseTX Twisted Pair 100m Full duplex o same protocol! Cat 5 UTP 100BaseFX Fiber Pair 100m Full duplex, log rus All hub based. Other types ot allowed. Hubs ca be shared or switched Sprig 2018 CS 438 Staff, Uiversity of Illiois 45
..ad beyod Gigabit etheret commo i PCs 100 GB etheret stadard ratified i Jue 2010 Sprig 2018 CS 438 Staff, Uiversity of Illiois 46
Etheret i Practice Number of hosts Limited to 200 i practice, stadard allows 1024 Rage Typically much shorter tha 2.5km limit i stadard Roud Trip Time Typically 5 or 10 µs, ot 50 Flow Cotrol Higher level flow cotrol limits load (e.g. TCP) Topology Star easier to admiister tha bus Eve better: exclusive access rather tha shared! Sprig 2018 CS 438 Staff, Uiversity of Illiois 47