roadcast Links, ddressing and Media ccess Control Message M C Message M Link Layer In a broadcast, there are two additional issues that must be resolved How do the nodes agree on who gets to use the next? Called the Media ccess Control problem How does tell that the frame is destined to not to C? ddressing problem: Each station must have a UNIQUE address, called the Media ccess Control (MC) address 3 Problem: Given a message M at a node consisting of several packets, how do you send the packets to a neighbor node Neighbor: node attached to the same Link can be point-to-point or broadcast Link can be guided media (a copper, coax, fiber wire) or unguided media (wireless) 1 roadcast Link (LN) MC ddresses Typically 48 bit (for most LNs) burned in adapter ROM Flat addresses, i.e., no hierarchical organization ddress space assigned and managed by IEEE Manufacturer buys portion of MC address space to ensure GLOL uniqueness Special LN broadcast address FF-FF-FF-FF-FF-FF 4 Link and Physical Layers Message M This communication problem is handled by 2 protocols Link Layer (LL) that sits on top of the layer (PL) and deals with Packet Encapsulation, Mux/Demux Framing Detecting frame boundaries Error Detection/Recovery Detecting corrupt frames Media ccess Control (if the is multi-access or broadcast) Reliable delivery, flow control? Optional Physical Layer (PL) deals with encoding/decoding bits of a frame to/from the 2
Ideal Multiple ccess Protocol roadcast channel of rate R bps 1. when one node wants to transmit, it can send at rate R. 2. when M nodes want to transmit, each can send at average rate R/M 3. fully decentralized: no special node to coordinate transmissions no synchronization of clocks, slots 4. simple Media ccess Control Protocols Three broad categories: Channel Partitioning divide channel into smaller pieces (time slots, frequency), allocate piece to node for exclusive use TDM, FDM Random ccess allow collisions recover from collisions Taking turns tightly coordinate shared access to avoid collisions Goal: efficient, fair, simple, decentralized 5 MC Protocols: a taxonomy Three broad classes: Channel Partitioning divide channel into smaller pieces (time slots, frequency, code) allocate piece to node for exclusive use Random ccess channel not divided, allow collisions recover from collisions Taking turns nodes take turns, but nodes with more to send can take longer turns 5: DataLink Layer 5-8 Random ccess MC Protocols When node has packet to send transmit at full channel data rate R. no a priori coordination among nodes two or more transmitting nodes -> collision, Random ccess MC protocol specifies: how to detect collisions how to recover from collisions (e.g., via delayed retransmissions) Examples of random access MC protocols: LOH, slotted LOH, CSM, CSM/CD 6
Random ccess Protocols When node has packet to send transmit at full channel data rate R. no a priori coordination among nodes two or more transmitting nodes collision, random access MC protocol specifies: how to detect collisions how to recover from collisions (e.g., via delayed retransmissions) Examples of random access MC protocols: slotted LOH LOH CSM, CSM/CD, CSM/C Channel Partitioning MC protocols: TDM TDM: time division multiple access access to channel in "rounds" each station gets fixed length slot (length = pkt trans time) in each round unused slots go idle example: 6-station LN, 1,3,4 have pkt, slots 2,5,6 idle 6-slot frame 1 3 4 1 3 4 5: DataLink Layer 5-11 5: DataLink Layer 5-9 Slotted LOH Channel Partitioning MC protocols: FDM ssumptions: all frames same size time divided into equal size slots (time to transmit 1 frame) nodes start to transmit only slot beginning nodes are synchronized if 2 or more nodes transmit in slot, all nodes detect collision Operation: when node obtains fresh frame, transmits in next slot if no collision: node can send new frame in next slot if collision: node retransmits frame in each subsequent slot with prob. p until success FDM: frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example: 6-station LN, 1,3,4 have pkt, frequency bands 2,5,6 idle FDM cable frequency bands 5: DataLink Layer 5-12 5: DataLink Layer 5-10
Pure (unslotted) LOH Slotted LOH unslotted loha: simpler, no synchronization when frame first arrives transmit immediately collision probability increases: frame sent at t 0 collides with other frames sent in [t 0-1,t 0 +1] 5: DataLink Layer 5-15 Pros single active node can continuously transmit at full rate of channel highly decentralized: only slots in nodes need to be in sync simple Cons collisions, wasting slots idle slots nodes may be able to detect collision in less than time to transmit packet clock synchronization 5: DataLink Layer 5-13 Pure loha efficiency P(success by given node) = P(node transmits). P(no other node transmits in [p 0-1,p 0 ]. P(no other node transmits in [p 0-1,p 0 ] = p. (1-p) N-1. (1-p) N-1 = p. (1-p) 2(N-1) choosing optimum p and then letting n -> infty... = 1/(2e) =.18 even worse than slotted loha! 5: DataLink Layer 5-16 Slotted loha efficiency Efficiency : long-run fraction of successful slots (many nodes, all with many frames to send) suppose: N nodes with many frames to send, each transmits in slot with probability p prob that given node has success in a slot = p(1-p) N-1 prob that any node has a success = Np(1-p) N-1 max efficiency: find p* that maximizes Np(1-p) N-1 for many nodes, take limit of Np*(1-p*) N-1 as N goes to infinity, gives: Max efficiency = 1/e =.37 t best: channel used for useful transmissions 37% of time!! 5: DataLink Layer 5-14
collisions can occur: propagation delay means two nodes may not hear each other s transmission collision: entire packet transmission time wasted CSM Collisions spatial layout of nodes along ethernet CSM (Carrier Sense Multiple ccess) CSM: listen before transmit: If channel sensed idle: transmit entire frame If channel sensed busy, defer transmission human analogy: don t interrupt others! note: role of distance and propagation delay in determining collision prob. 19 5: DataLink Layer 5-17 CSM/CD (Collision Detection) CSM/CD: carrier sense multiple access/collision detect collisions detected within short time colliding transmissions aborted, reducing channel wastage persistent or non-persistent retransmission collision detection: For wired LNs: measure signal strengths, compare transmitted, received signals CSM: Carrier Sense Multiple ccess Listen before transmit: If channel sensed idle: transmit entire pkt If channel sensed busy, defer transmission Persistent CSM: retry immediately with probability p when channel becomes idle Non-persistent CSM: retry after random interval 20 18
Taking Turns MC protocols Polling: master node invites slave nodes to transmit in turn (US) Request to Send, Clear to Send msgs (802.11) concerns: polling overhead latency single point of failure (master) Used in US Token passing: control token passed from one node to next sequentially. token message concerns: token overhead latency single point of failure (token) CSM/CD Collision Detection 23 21 Taking Turns MC protocols Taking Turns MC protocols channel partitioning MC protocols: Polling: master node invites slave nodes to transmit in turn typically used with dumb slave devices concerns: polling overhead latency single point of failure (master) slaves data data poll master share channel efficiently and fairly at high load inefficient at low load: delay in channel access, 1/N bandwidth allocated even if only 1 active node! Random access MC protocols efficient at low load: single node can fully utilize channel high load: collision overhead taking turns protocols look for best of both worlds! 5: DataLink Layer 5-24 5: DataLink Layer 5-22
Functionality of a LL With MC Protocol H H LL Frame dd Framing Information Media ccess Control Encode its to the Link Link EDC LL PL LL PL H D-MC == MyMC D-MC == FFFFFFFFFFFF Link Y Y ll bits in D OK? Decode its from the Link N Detected error D EDC N Drop the frame 27 Taking Turns MC protocols Token passing: control token passed from one node to next sequentially. token message concerns: token overhead latency single point of failure (token) (nothing to send) T 5: DataLink Layer 5-25 T data 5.1 Introduction and services 5.2 Error detection and correction 5.3Multiple access protocols 5.4 Link-Layer ddressing 5.5 Ethernet Link Layer 5.6 Link-layer switches 5.7 PPP 5.8 Link virtualization: MPLS 5.9 day in the life of a web request Summary of MC protocols channel partitioning, by time, frequency or code Time Division, Frequency Division random access (dynamic), LOH, S-LOH, CSM, CSM/CD carrier sensing: easy in some technologies (wire), hard in others (wireless) CSM/CD used in Ethernet CSM/C used in 802.11 taking turns polling from central site, token passing luetooth, FDDI, IM Token Ring 5: DataLink Layer 5-28 5: DataLink Layer 5-26
LN ddress (more) MC address allocation administered by IEEE manufacturer buys portion of MC address space (to assure uniqueness) analogy: (a) MC address: like Social Security Number (b) IP address: like postal address MC flat address portability can move LN card from one LN to another IP hierarchical address NOT portable address depends on IP subnet to which node is attached MC ddresses and RP 32-bit IP address: network-layer address used to get datagram to destination IP subnet MC (or LN or or Ethernet) address: function: get frame from one interface to another ly-connected interface (same network) 48 bit MC address (for most LNs) burned in NIC ROM, also sometimes software settable 5: DataLink Layer 5-31 5: DataLink Layer 5-29 RP: ddress Resolution Protocol LN ddresses and RP Question: how to determine MC address of knowing s IP address? 137.196.7.23 71-65-F7-2-08-53 LN 137.196.7.78 1-2F--76-09-D 137.196.7.14 58-23-D7-F-20-0 Each IP node (host, router) on LN has RP table RP table: IP/MC address mappings for some LN nodes < IP address; MC address; TTL> TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) Each adapter on LN has unique LN address 71-65-F7-2-08-53 LN (wired or wireless) 1-2F--76-09-D 58-23-D7-F-20-0 roadcast address = FF-FF-FF-FF-FF-FF = adapter 137.196.7.88 0C-C4-11-6F-E3-98 5: DataLink Layer 5-32 0C-C4-11-6F-E3-98 5: DataLink Layer 5-30
creates IP datagram with source, destination uses RP to get R s MC address for 111.111.111.110 creates -layer frame with R's MC address as dest, frame contains -to- IP datagram s NIC sends frame R s NIC receives frame R removes IP datagram from Ethernet frame, sees its destined to R uses RP to get s MC address R creates frame containing -to- IP datagram sends to 74-29-9C-E8-FF-55 111.111.111.111 111.111.111.112 CC-49-DE-D0--7D E6-E9-00-17--4 1-23-F9-CD-06-9 222.222.222.220 111.111.111.110 R This is a really important example make sure you understand! 88-2-2F-54-1-0F 222.222.222.221 222.222.222.222 49-D-D2-C7-56-2 5: DataLink Layer 5-35 RP protocol: Same LN (network) wants to send datagram to, and s MC address not in s RP table. broadcasts RP query packet, containing 's IP address dest MC address = FF- FF-FF-FF-FF-FF all machines on LN receive RP query receives RP packet, replies to with its ('s) MC address frame sent to s MC address (unicast) caches (saves) IP-to- MC address pair in its RP table until information becomes old (times out) soft state: information that times out (goes away) unless refreshed RP is plug-and-play : nodes create their RP tables without intervention from net administrator 5: DataLink Layer 5-33 ddressing: routing to another LN walkthrough: send datagram from to via R assume knows s IP address 74-29-9C-E8-FF-55 111.111.111.111 E6-E9-00-17--4 1-23-F9-CD-06-9 88-2-2F-54-1-0F 222.222.222.221 111.111.111.112 CC-49-DE-D0--7D 222.222.222.220 111.111.111.110 R 222.222.222.222 49-D-D2-C7-56-2 two RP tables in router R, one for each IP network (LN) 5: DataLink Layer 5-34