CSE 461 Multiple Access David Wetherall djw@cs.washington.edu
How to share a link Multiplexing = networking term for sharing a resource among multiple users (e.g., link, protocol instance) Topics: Multiplexing methods (context) Statistical multiplexing (general principle) Random access protocols (designs) Wireless protocols (important case) Contention-free protocols (designs) Application Transport Network Link Physical djw // CSE 461, Spring 2011 2
Basic multiplexing l i methods Divide channels over: Time (TDM) Frequency, or wavelength (FDM / WDM) Codes (CDMA) Also spatial for wireless, e.g., directional antenna [skip!] Often used in combination E.g., g, 802.11 uses FDM for 20 MHz channels, then dynamic TDM as stations take turns, then FDM via OFDM within the channel to combat wireless degradations. Wow! djw // CSE 461, Spring 2011 3
Frequency Division i i Multiple l Access Simultaneous transmission in different frequency bands Analog: Radio/TV, AMPS cell phones (800MHz) Also called Wavelength DMA (WDMA) for fiber phone call freq guard bands Speaking at different pitches djw // CSE 461, Spring 2011 4
Time Division i i Multiple l Access Timeslice given frequency band between users Digital: used extensively inside the telephone network T1 (1.5Mbps) is 24 x 8 bits/125us; also E1 (2Mbps, 32 slots) timeslot Speaking at different times time Advantage: lower delay; Disadvantage: synchronization djw // CSE 461, Spring 2011 5
Code Division i i Multiple l Access Transmit: Give each user a different code (right) Codes are orthogonal to each other Send +ve or ve code for 1 or 0 All users send at once (channel sees sum) Receive: Correlate for each code; factors out the rest Uses bandwidth for N users code rate >> data rate Widely used for 3G mobile phones Four 4 chip orthogonal codes djw // CSE 461, Spring 2011 6
Statistical ti ti Multiplexing l i Static partitioning schemes are not suited to data communications where peak rate >> average rate. If we share on demand we can support more users Based on the statistics of their transmissions Occasionally we might be oversubscribed This is called statistical multiplexing Statistical multiplexing is heavily used in data networks But only at a high-level (tied to users) this is a poor model for the details of traffic due to heavy-tailed distributions. djw // CSE 461, Spring 2011 7
Example DSL user sends at 10 Mbps but is idle 90% of the time. What are the likely loads at ISP if we share on demand? Say 100 Mbps ISP link; 10 users if statically allocated Prob Prob 2 users 10 users 0 10 20 Mbps 0 10 100 Mbps djw // CSE 461, Spring 2011 8
Example continued For 10 users, Prob(need 100 Mbps) = 10-10 Not likely! For 40 users, Prob(>10 active users) = 0.15%, very low! We can support 4X users! But: important caveats djw // CSE 461, Spring 2011 9
Random Access Protocols Let stations try to send when they have traffic Contention leads to collisions (inefficiency, non-determinism) Designs: Aloha (greedy) Carrier Sense Multiple Access (CSMA) (non-greedy) CSMA (p-persistent, CSMA/CA) (greedy) CSMA with Collision Detection (CSMA/CD) Above with Binary Exponential Backoff In increasing order of sophistication and performance djw // CSE 461, Spring 2011 10
ALOHA Wireless links between the Hawaiian islands in the 70s Want distributed allocation no special channels, or single point of failure Aloha protocol: Just send when you have data! There will be some collisions of course Dt Detect terrored dframes and retransmit a random time later lt Simple, decentralized and works well for low load For many users, analytic traffic model, max efficiency is 18% djw // CSE 461, Spring 2011 11
Carrier Sense Multiple l Access We can do better by listening before we send (CSMA) good defense against collisions only if a is small (LANs) A X collision B (wire) a parameter: number of packets that fit on the wire a = bandwidth * delay / packet size; a BD product measure Small (<<1) for LANs, large (>>1) for satellites djw // CSE 461, Spring 2011 12
What if the Channel is Busy? 1-persistent CSMA Wait until idle then go for it Blocked senders can queue up and collide non-persistent CSMA Wait a random time and try again Less greedy when loaded, but larger delay p-persistent CSMA When idle send with prob p until done; assumed slotted time Choose p so p * # senders < 1; avoids collisions at cost of delay CSMA/CA ( Collision Avoidance ) used in 802.11 is a refinement of p-persistencepersistence djw // CSE 461, Spring 2011 13
CSMA with Collision i Detection ti Even with CSMA there can still be collisions. Why? Time for B to detect As A s transmission A X collision B (wire) For wired media we can detect all collisions and abort (CSMA/CD): Requires a minimum frame size ( acquiring the medium ) B must continue sending ( jam ) until A detects collision djw // CSE 461, Spring 2011 14
Binary Exponential Backoff Build on CSMA to balance average wait with load Adapt p to become less greedy when there is more contention On collision: jam and exponential backoff Jamming: send 48 bit sequence to ensure collision detection Backoff: First collision: wait 0 or 1 frame times at random and retry Second time: wait 0, 1, 2, or 3 frame times Nth time (N<=10): wait 0, 1,, 2 N -1 times Max wait 1023 frames, give up after 16 attempts djw // CSE 461, Spring 2011 15
Classic Ethernet t (Historical) i IEEE 802.3 or classic Ethernet LAN MAC is 1-persistent CSMA/CD with BEB PHY is 10 Mbps over coax, baseband signals, Manchester encoding Link error detection is 32 bit CRC. No ACKs or retransmissions. djw // CSE 461, Spring 2011 16
Modern Switched Ethernet t Used now for gigabit Ethernet We ll cover this next lecture Switch To other switches Switch ports Twisted pair djw // CSE 461, Spring 2011 17
Wireless Multiple l Access Wireless is more complicated than wired 1. Cannot reliably detect t collisions i Transmitter swamps co-located receiver CSMA with collision avoidance (CSMA/CA) 2. Different transmitters have different coverage areas Asymmetries lead to hidden/exposed terminal problems RTS/CTS as a coordination mechanism djw // CSE 461, Spring 2011 18
CSMA with Collision i Avoidance If you can t detect collisions, try to avoid them Insert a random number of small backoff slots before sending Even if the medium appears to be idle (CSMA/CA) B and C choose different backoffs and avoid a collision (below) B and C would have collided with classic Ethernet djw // CSE 461, Spring 2011 19
Hidden Terminals A and C can both send to B but can t hear each other A is a hidden terminal for C and vice versa CSMA not effective want to sense at receiver djw // CSE 461, Spring 2011 20
Exposed Terminals B, C can hear each other but can safely send to A, D Compare to spatial 2 reuse in cell 1 phones: 1 3 djw // CSE 461, Spring 2011 21
RTS /CTSt to handle hidden terminals 1. A stimulates B with Request to Send (RTS) in left figure 2. C and E hear RTS and defer to allow the upcoming CTS 3. B replies to A with Clear to Send (CTS) in right figure 4. D and E hear CTS and defers to allow the upcoming data 5. A sends data to B djw // CSE 461, Spring 2011 22
802.11 Wireless LAN Dominant standard with many PHY/MAC options/features Access To Network Point Client Wireless APs to clients plus wired infrastructure between APs MAC avoids collisions with CSMA/CA; RTS/CTS largely unused Link reliability with CRC32 plus ACKs and retransmissions Many PHY rates for varying SNR; much PHY processing to go fast djw // CSE 461, Spring 2011 23
Contention-free ti Protocols Collisions are the main difficulty with random schemes Q: Can we avoid collisions altogether? A: Yes. By taking turns or with reservations More generally, what else might we want? Deterministic service, priorities/qos, reliability Factor these into the turn-taking rules djw // CSE 461, Spring 2011 24
Token Ring Station Token Direction of transmission Token rotates permission to send around the ring of nodes Sender injects packet into ring and removes later Can do Early or Delayed (wait to see packet again) token release Nodes need to ensure health of ring in case token is lost Examples: token ring (802.5), FDDI, Resilient Packet Ring (802.17) Don t need a physical ring could use station order on a bus djw // CSE 461, Spring 2011 25
Narratives Simple, randomized CSMA keeps popping up Aloha, classic Ethernet, 802.11, cable modems, RFID More complex contention-free keeps getting beat out 802.5, FDDI, DQDB, 802.17? Combinations may offer the best of both worlds: Use random schemes for new request traffic and grant contention-free bandwidth for ongoing regular traffic Can improve efficiency/scalability but use centralized point E.g., cable modems, 3G wireless djw // CSE 461, Spring 2011 26