Dat a Link Layer Goals: Over view: underst and principles link - - PDF document

dat a link layer
SMART_READER_LITE
LIVE PREVIEW

Dat a Link Layer Goals: Over view: underst and principles link - - PDF document

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


slide-1
SLIDE 1

1

5: Dat aLink Layer 5a-1

13: Link Layer, Mult iple Access P rot ocols

Last Modif ied: 4/ 9/ 2003 2:32:56 PM

5: Dat aLink Layer 5a-2

Dat a Link Layer

Goals:

underst and principles

behind dat a link layer services:

shar ing a br oadcast

channel: mult iple access

link layer addressing error det ect ion,

cor r ect ion inst ant iat ion and

implement at ion of various link layer t echnologies

Over view:

link layer services error det ect ion, correct ion mult iple access prot ocols and

LANs

link layer addressing, ARP specif ic link layer t echnologies:

Et hernet hubs, bridges, swit ches I EEE 802.11 LANs PPP ATM 5: Dat aLink Layer 5a-3

Link Layer: set t ing t he cont ext

t wo physically connect ed devices:

host- rout er, rout er- rout er, host- host

unit of dat a: f rame

applicat ion t r anspor t net work link physical net work link physical

M M M M Ht Ht Hn Ht Hn Hl M Ht Hn Hl f rame

  • phys. link

dat a link prot ocol adapt er car d

5: Dat aLink Layer 5a-4

Link Layer

Node-to-node connect ivit y 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:

Point-to-point (single wir e, e.g. PPP, SLI P) Br oadcast (shar ed wir e or medium; e.g,

Et her net or wir eless)

Swit ched (e.g., swit ched Et her net , ATM et c)

5: Dat aLink Layer 5a-5

Communicat ion Technologies

Wired LANs, Wireless LANs (RF or light ),

Cellular Telephones, Sat ellit es, Packet Radio, Wir ed Telephone, Voice

5: Dat aLink Layer 5a-6

Dat a Model?

Packet Mode – burst y discret e

t ransmissions

Circuit Mode – cont inuous t r af f ic

slide-2
SLIDE 2

2

5: Dat aLink Layer 5a-7

Basics of Link Layer

Mult iple Access Prot ocols Error Det ect ion/ Correct ion

5: Dat aLink Layer 5a-8

Mult iple Access

Mult iple Access - f undament al t o

communicat 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-9

Mult iple Access prot ocols

Algor it hm t hat det er mines how st at ions shar e channel,

i.e., det er mine when st at ion can t r ansmit

Not e: communicat ion about channel shar ing must use

channel it self ! (or be agr eed upon ahead of t ime)

what t o look f or in mult iple access pr ot ocols:

synchr onous or asynchr onous inf or mat ion needed about ot her st at ions r obust ness (e.g., t o channel er r or s) per f or mance

5: Dat aLink Layer 5a-10

MAC P rot ocols: a t axonomy

Three broad classes:

Channel Par t it ioning

divide channel int o smaller “pieces” (t ime slot s,

f requency)

allocat e piece t o node f or exclusive use

Random Access

allow collisions “r ecover ” f r om collisions

Polling St yle

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-11

Channel P art it ioning : TDMA

TDMA: t ime division mult iple access

access t o channel in "r ounds" each st at ion get s f ixed lengt h slot (lengt h = pkt

t r ans t ime) in each r ound

unused slot s go idle example: 6-st at ion LAN, 1,3,4 have pkt , slot s 2,5,6

idle

5: Dat aLink Layer 5a-12

Channel P art it ioning : FDMA

FDMA: f requency division mult iple access

channel spect r um divided int o f r equency bands

each st at ion assigned f ixed f requency band

unused t r ansmission t ime in f r equency bands go idle example: 6-st at ion LAN, 1,3,4 have pkt , f r equency

bands 2,5,6 idle

f r equency bands time

slide-3
SLIDE 3

3

5: Dat aLink Layer 5a-13

Channel P art it ioning: CDMA

CDMA (Code Division Mult iple Access)

unique “code” assigned t o each user;ie, code set part it ioning used most ly in wireless broadcast channels (cellular,

sat ellit e,et c)

all users share same f requency, but each user has own

“chipping” sequence (ie, code) t o encode dat a

encoded signal = (original dat a) X (chipping sequence) decoding: inner - product of encoded signal and chipping

sequence

allows mult iple users t o “coexist ” and t ransmit

simult aneously wit h minimal int erf erence (if codes are “ort hogonal”)

5: Dat aLink Layer 5a-14

TDMA vs FDMA

I n TDMA, each st at ion get s t he whole channel spect rum

some of t he t ime I n FDMA, each st at ion get s par t of t he channel

spect rum all of t he t ime

I n CDMA, each st at ion is assigned a code t hat

det er mines what por t ions of t he channel spect r um t hey use and f or how long t o avoid collision wit h

  • t her s

All r equir e lot s of coor dinat ion about who “speaks”

when and in what way!

What if didn’t want t o coordinat e t hings so t ight ly?

5: Dat aLink Layer 5a-15

Random Access prot ocols

Random access prot ocols are alt ernat ive t o

t ight coordinat ion

When want t o t r ansmit , t r ansmit and hope f or

t he best

I f bad t hings happen, pr ot ocol says how t o

recover

5: Dat aLink Layer 5a-16

Random Access P rot ocols

When node has packet t o send

t ransmit at f ull channel dat a rat e R. no a priori coordinat ion among nodes

t wo or mor e t r ansmit t ing nodes ->

“collision”,

r andom access MAC pr ot ocol specif ies:

how t o det ect collisions 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-17

Random Access: Slot t ed Aloha

t ime is divided int o equal size slot s (= pkt t r ans. t ime) node wit h new ar r iving pkt : t r ansmit at beginning of

next slot

if collision: r et r ansmit pkt in f ut ur e slot s wit h

pr obabilit y p, unt il successf ul.

Success (S), Collision (C), Empty (E) slots

5: Dat aLink Layer 5a-18

Slot t ed Aloha ef f iciency

Q: what is max f ract ion slot s successf ul?

A: Suppose N st at ions have packet s t o send

each t r ansmit s in slot wit h pr obabilit y p pr ob. successf ul t r ansmission S is:

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) = N p (1- p)(N- 1)

… choosing opt imum p as n ->inf t y ...

= 1/ e = .37 as N - > inf t y

At best : channel use f or usef ul t ransmissions 37%

  • f t ime!
slide-4
SLIDE 4

4

5: Dat aLink Layer 5a-19

Random Access: P ure (unslot t ed) ALOHA

unslot t ed Aloha: simpler , no synchr onizat ion pkt needs t r ansmission:

send wit hout await ing f or beginning of slot

collision pr obabilit y incr eases:

pkt sent at t 0 collide wit h ot her pkt s sent in [t 0- 1, t 0+1]

5: Dat aLink Layer 5a-20

Pure Aloha (cont .)

P (success by given node) = P (node t ransmit s) . P (no ot her node t ransmit s in [p0- 1,p0] . P (no ot her node t ransmit s in [p0- 1,p0] = p . (1- p) . (1

  • p)

P(success by any of N nodes) = N p

. (1- p) . (1

  • p)

… choosing opt imum p as n -> inf t y ... = 1/ (2e) = .18

S = t hr oughput = “goodput ” (success rat e) G = of f ered load = Np

0.5 1.0 1.5 2.0 0.1 0.2 0.3 0.4

Pure Aloha Slot t ed Aloha

pr ot ocol const r ains ef f ect ive channel t hroughput !

5: Dat aLink Layer 5a-21

CSMA: Carrier Sense Mult iple Access

CSMA: list en bef or e t r ansmit :

I f channel sensed idle: t r ansmit ent ir e pkt I f channel sensed busy, def er t r ansmission

Per sist ent CSMA: r et r y immediat ely wit h

pr obabilit y p when channel becomes idle (may cause inst abilit y)

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!

5: Dat aLink Layer 5a-22

CSMA collisions

collisions can occur :

propagat ion delay means t wo nodes may not year hear each ot her’s t ransmission

collision:

ent ire packet t ransmission t ime wast ed

spat ial layout of nodes along et her net

not e:

role of dist ance and propagat ion delay in det ermining collision prob.

5: Dat aLink Layer 5a-23

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 5a-24

CSMA/ CD collision det ect ion

slide-5
SLIDE 5

5

5: Dat aLink Layer 5a-25

Compromise? P

  • lling St yle MAC

prot ocols

channel par t it ioning MAC pr ot ocols:

shar e channel ef f icient ly at high load inef f icient at low load: delay in channel access,

1/ N bandwidt h allocat ed even if only 1 act ive node! Random access MAC pr ot ocols

ef f icient at low load: single node can f ully

ut ilize channel

high load: collision over head

Polling st yle pr ot ocols (“t aking t ur ns”) look f or best of bot h worlds!

5: Dat aLink Layer 5a-26

P

  • lling st yle MAC prot ocols

Polling:

mast er node

“invit es” slave nodes t o t ransmit in t urn

Request t o Send,

Clear t o Send msgs

concer ns:

polling overhead lat ency single point of

f ailure (mast er)

Token passing:

cont rol token passed f r om

  • ne node t o next

sequent ially.

t oken message concer ns:

t oken overhead lat ency single point of f ailure (t oken)

5: Dat aLink Layer 5a-27

Reservat ion-based prot ocols

Dist r ibut ed Polling:

t ime divided int o slot s begins wit h N shor t reservat ion slot s

reservat ion slot t ime equal t o channel end- end propagat ion

delay

st at ion wit h message t o send post s reservat ion reservat ion seen by all st at ions

af t er reservat ion slot s, message t ransmissions ordered by

known priorit y

5: Dat aLink Layer 5a-28

Summary of MAC prot ocols

What do you do wit h a shar ed media?

Channel Par t it ioning, by t ime, f r equency or code

  • Time Division,Code Division, Frequency Division

Random access

  • ALOHA, S- ALOHA, CSMA, CSMA/ CD
  • carrier sensing: easy in some t echnologies (wire), hard

in ot hers (wireless)

  • CSMA/ CD used in Et hernet

Polling St yle

  • polling f rom a cent ral cit e, t oken passing

5: Dat aLink Layer 5a-29

Basics of Link Layer

Mult iple Access Prot ocols Error Det ect ion/ Correct ion

5: Dat aLink Layer 5a-30

Error Det ect ion

EDC= Error Det ect ion and Correct ion bit s (redundancy) D = Dat a prot ect ed by error checking, may include header f ields

  • Error det ect ion not 100% reliable!
  • prot ocol may miss some errors, but rarely
  • larger EDC f ield yields bet t er det ect ion and correct ion
slide-6
SLIDE 6

6

5: Dat aLink Layer 5a-31

Smart Redundancy

I n general, more bit s of redundancy t he

st ronger t he error det ect ion/ correct ion abilit ies but smart redundancy

What if t ransmit t ed anot her copy of t he

same t hing?

How many bit s t ill not det ect ed? Abilit y t o

correct ? Can we do bet t er t han t hat wit h less

space?

5: Dat aLink Layer 5a-32

Recall: I nt ernet checksum

Sender:

t reat segment cont ent s as sequence of 16- bit int egers checksum: addit ion (1’s complement sum) of segment

cont ent s

sender put s checksum value int o UDP

checksum f ield Receiver:

comput e checksum of received segment check if comput ed checksum equals checksum f ield value

We saw t his a bunch of t imes in upper layer s – is t his a good choice f or t he link layer ?

5: Dat aLink Layer 5a-33

I nt elligent choice f or link layer?

Tailored t o t ype and f requency of errors

expect ed in t he specif ic t echnology being used

Some t echnologies (like f iber) have very low

error rat es

Some t echnologies (like wir eless) have high

error rat es How t o we t ailor t he number of bit s t o use

and *how* we use t hem t o get t he desired ef f ect ??

5: Dat aLink Layer 5a-34

Example: P arit y

Single Bit Par it y:

Detect single bit errors

Two Dimensional Bit Par it y:

Detect and correct single bit errors Want even number of 1’s in each dimension

Single Bit vs Two Dimensional Bit Par it y: Example of using r edundant bit s int elligent ly f or incr eased er r or det ect ion/ cor r ect ion capabilit y!

5: Dat aLink Layer 5a-35

Beyond parit y?

How can we gener alize t his example of

single vs double bit parit y?

I s t here a t heory of using redundant bit s

ef f icient ly based on t he t ypes of errors we expect t o f ind?

Cyclic Redundancy Checks (CRC) views bot h

t he dat a and t he redundant bit s as binary polynomials and ensures t hat t hey sat isf y a cer t ain mat hemat ical r elat ionship

5: Dat aLink Layer 5a-36

Checksumming: Cyclic Redundancy Check

view dat a bit s, D, as a binary number or binary polynomial

101011= X^5+X^3+X^1+X^0 = X^5+X^3+X+1.

choose r+1 bit pat t ern/ polynomial (generat or), G goal: choose r CRC bit s, R, such t hat

<

D, R> = D* 2r XOR R (shif t D over place R in t he end)

<

D,R> exact ly divisible by G (modulo 2)

receiver knows G, divides <

D,R> by G. I f non-zero remainder: error det ect ed!

can det ect all bur st er r or s less t han r +1 bit s

widely used in pract ice (ATM, HDCL)

slide-7
SLIDE 7

7

5: Dat aLink Layer 5a-37

CRC Example

Want : D.2r XOR R = nG equivalent ly: if we divide D.2r by G, want reminder R

R = r emainder [ ] D.2 r G

5: Dat aLink Layer 5a-38

Common CRC P

  • lynomials (G)

CRC

  • 12 used f or t r ansmission of st r eams of 6-bit

char act er s and gener at es 12-bit FCS

CRC-12: X^12+X^11+X^3+X^2+X+1

Bot h CRC

  • 16 and CCRC
  • CCI TT ar e used f or 8 bit

t r ansmission st r eams and bot h r esult in 16 bit

  • FCS. Consider ed t o give adequat e pr ot ect ion f or

most applicat ions.

CRC-16: X^16+X^15+X^2+1 (USA) CRC-CCI TT: X^16+X^12+X^5+1 (Europe)

CRC

  • 32 gives ext r a gener at es 32 bit FCS. Used by

t he local net wor k st andar ds commit t ee (I EEE- 802) and in some DOD applicat ions.

CRC-32:

X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X ^7+X^5+X^4+X^2+X+1