Dat a Link Layer Goals: Over view: � underst and principles � link layer services 13: behind dat a link layer � error det ect ion, correct ion services: Link Layer, Mult iple Access � mult iple access prot ocols and � shar ing a br oadcast LANs channel: mult iple access P rot ocols � link layer addressing, ARP � link layer addressing � specif ic link layer t echnologies: � error det ect ion, � Et hernet cor r ect ion � hubs, bridges, swit ches � inst ant iat ion and Last Modif ied: � I EEE 802.11 LANs implement at ion of various 4/ 9/ 2003 2:32:56 PM link layer t echnologies � PPP � ATM 5: Dat aLink Layer 5a-1 5: Dat aLink Layer 5a-2 Link Layer Link Layer: set t ing t he cont ext � t wo physically connect ed devices: � Node-to-node connect ivit y � host- rout er, rout er- rout er, host- host � unit of dat a: f rame � Point-to-point or mult iple access � Mult iple access r equir es addr essing � Bot h r equir e r ules f or shar ing t he links � Examples: M applicat ion � Point-to-point (single wir e, e.g. PPP, SLI P) H t M t r anspor t net work � Br oadcast (shar ed wir e or medium; e.g, net work dat a link H n H t M prot ocol link link H l H n H t M Et her net or wir eless) H l H n H t M physical physical f rame � Swit ched (e.g., swit ched Et her net , ATM et c) phys. link adapt er car d 5: Dat aLink Layer 5a-3 5: Dat aLink Layer 5a-4 Dat a Model? Communicat ion Technologies � Packet Mode – burst y discret e t ransmissions � Circuit Mode – cont inuous t r af f ic � Wired LANs, Wireless LANs (RF or light ), Cellular Telephones, Sat ellit es, Packet Radio, Wir ed Telephone, Voice 5: Dat aLink Layer 5: Dat aLink Layer 5a-5 5a-6 1
Basics of Link Layer Mult iple Access � Mult iple Access Prot ocols � Mult iple Access - f undament al t o communicat ion � Error Det ect ion/ Correct ion � Two or more communicat ors use a shared medium t o share inf ormat ion � Mult iple Access Prot ocol - Rule f or shar ing medium t o f acilit at e communicat ion? � Can simult aneous t r ansmissions cause int er f er ence? � Claim: humans use mult iple access prot ocols all t he t ime 5: Dat aLink Layer 5a-7 5: Dat aLink Layer 5a-8 Mult iple Access prot ocols MAC P rot ocols: a t axonomy Three broad classes: � Algor it hm t hat det er mines how st at ions shar e channel, � Channel Par t it ioning i.e., det er mine when st at ion can t r ansmit � divide channel int o smaller “pieces” (t ime slot s, � Not e: communicat ion about channel shar ing must use f requency) channel it self ! (or be agr eed upon ahead of t ime) � allocat e piece t o node f or exclusive use � what t o look f or in mult iple access pr ot ocols: � Random Access � synchr onous or asynchr onous � allow collisions � inf or mat ion needed about ot her st at ions � “r ecover ” f r om collisions � r obust ness (e.g., t o channel er r or s) � Polling St yle � per f or mance � t ight ly coordinat e shared access t o avoid collisions Goal: ef f icient , f air, simple, decent ralized 5: Dat aLink Layer 5a-9 5: Dat aLink Layer 5a-10 Channel P art it ioning : TDMA Channel P art it ioning : FDMA TDMA: t ime division mult iple access FDMA: f requency division mult iple access � channel spect r um divided int o f r equency bands � access t o channel in "r ounds" � each st at ion assigned f ixed f requency band � each st at ion get s f ixed lengt h slot (lengt h = pkt � unused t r ansmission t ime in f r equency bands go idle t r ans t ime) in each r ound � example: 6-st at ion LAN, 1,3,4 have pkt , f r equency � unused slot s go idle bands 2,5,6 idle � example: 6-st at ion LAN, 1,3,4 have pkt , slot s 2,5,6 idle time f r equency bands 5: Dat aLink Layer 5: Dat aLink Layer 5a-11 5a-12 2
Channel P art it ioning: CDMA TDMA vs FDMA � I n TDMA, each st at ion get s t he whole channel spect rum CDMA (Code Division Mult iple Access) some of t he t ime � unique “code” assigned t o each user;ie, code set part it ioning � I n FDMA, each st at ion get s par t of t he channel � used most ly in wireless broadcast channels (cellular, spect rum all of t he t ime sat ellit e,et c) � all users share same f requency, but each user has own � I n CDMA, each st at ion is assigned a code t hat “chipping” sequence (ie, code) t o encode dat a det er mines what por t ions of t he channel spect r um � encoded signal = (original dat a) X (chipping sequence) t hey use and f or how long t o avoid collision wit h � decoding: inner - product of encoded signal and chipping ot her s sequence � All r equir e lot s of coor dinat ion about who “speaks” � allows mult iple users t o “coexist ” and t ransmit when and in what way! simult aneously wit h minimal int erf erence (if codes are � What if didn’t want t o coordinat e t hings so t ight ly? “ort hogonal”) 5: Dat aLink Layer 5a-13 5: Dat aLink Layer 5a-14 Random Access prot ocols Random Access P rot ocols � When node has packet t o send � Random access prot ocols are alt ernat ive t o � t ransmit at f ull channel dat a rat e R. t ight coordinat ion � no a priori coordinat ion among nodes � When want t o t r ansmit , t r ansmit and hope f or � t wo or mor e t r ansmit t ing nodes -> “collision”, t he best � r andom access MAC pr ot ocol specif ies: � I f bad t hings happen, pr ot ocol says how t o � how t o det ect collisions recover � how t o recover f rom collisions (e.g., via delayed ret ransmissions) � Examples of r andom access MAC pr ot ocols: � slot t ed ALOHA � ALOHA � CSMA and CSMA/ CD (Et hernet ) � Remember Et hernet grew out of t echnology f or broadcast in Hawaiian I slands? 5: Dat aLink Layer 5a-15 5: Dat aLink Layer 5a-16 Random Access: Slot t ed Aloha Slot t ed Aloha ef f iciency Q: what is max f ract ion slot s successf ul? � t ime is divided int o equal size slot s (= pkt t r ans. t ime) A: Suppose N st at ions have packet s t o send � node wit h new ar r iving pkt : t r ansmit at beginning of � each t r ansmit s in slot wit h pr obabilit y p next slot � pr ob. successf ul t r ansmission S is: � if collision: r et r ansmit pkt in f ut ur e slot s wit h pr obabilit y p, unt il successf ul. by single node: S= (prob it sends) * (prob all ot hers do not ) = p (1- p) (N- 1) by any of N nodes S = Prob (only one t ransmit s) At best : channel = N p (1- p) (N- 1) use f or usef ul … choosing opt imum p as n ->inf t y ... t ransmissions 37% of t ime! = 1/ e = .37 as N - > inf t y Success (S), Collision (C), Empty (E) slots 5: Dat aLink Layer 5: Dat aLink Layer 5a-17 5a-18 3
Random Access: P ure Pure Aloha (cont .) (unslot t ed) ALOHA (node t ransmit s) . P (success by given node) = P � unslot t ed Aloha: simpler , no synchr onizat ion � pkt needs t r ansmission: (no ot her node t ransmit s in [p 0 - 1,p 0 ] . P � send wit hout await ing f or beginning of slot P (no ot her node t ransmit s in [p 0 - 1,p 0 ] � collision pr obabilit y incr eases: = p . (1- p) . (1 - p) � pkt sent at t 0 collide wit h ot her pkt s sent in [t 0 - 1, t 0 +1] . (1- p) . (1 P(success by any of N nodes) = N p - p) S = t hr oughput = “goodput ” … choosing opt imum p as n -> inf t y ... = 1/ (2e) = .18 0.4 0.3 (success rat e) pr ot ocol const r ains Slot t ed Aloha ef f ect ive channel 0.2 t hroughput ! 0.1 Pure Aloha 1.5 0.5 1.0 2.0 G = of f ered load = Np 5: Dat aLink Layer 5a-19 5: Dat aLink Layer 5a-20 CSMA: Carrier Sense Mult iple Access CSMA collisions spat ial layout of nodes along et her net collisions can occur : CSMA : list en bef or e t r ansmit : propagat ion delay means t wo nodes may not year � I f channel sensed idle: t r ansmit ent ir e pkt hear each ot her’s � I f channel sensed busy, def er t r ansmission t ransmission � Per sist ent CSMA: r et r y immediat ely wit h pr obabilit y p when channel becomes idle (may cause collision: inst abilit y) ent ire packet t ransmission t ime wast ed � Non-persist ent CSMA: r et r y af t er r andom int er val � human analogy: don’t int er r upt ot her s! not e: role of dist ance and propagat ion delay in det ermining collision prob. 5: Dat aLink Layer 5a-21 5: Dat aLink Layer 5a-22 CSMA/ CD (Collision Det ect ion) CSMA/ CD collision det ect ion CSMA/ CD: car r ier sensing, def er r al as in CSMA � collisions det ect ed wit hin short t ime � colliding t ransmissions abort ed, reducing channel wast age � persist ent or non- persist ent ret ransmission � collision det ect ion: � easy in wired LANs: measure signal st rengt hs, compare t ransmit t ed, received signals � dif f icult in wireless LANs: receiver shut of f while t ransmit t ing � human analogy: if st ar t t alking at same t ime some one else does don’t j ust cont inue t alking 5: Dat aLink Layer 5: Dat aLink Layer 5a-23 5a-24 4
Recommend
More recommend