medium access protocol b yengr. fawad khan uet bannu kp pakistan

33
1 Module 13 Medium access control

Upload: irfan-sami-marwat

Post on 11-Jan-2017

255 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

1

Module 13

Medium access control

Link Layer 5-2

Multiple access links protocolsTwo types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch amp host

broadcast (shared wire or medium) Shared wire (coaxial) old-fashioned Ethernet Shared wireless (RF) 80211WiFi satellite

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

Link Layer 5-3

Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes

interfere collision if node receives two or more signals at the

same time

multiple access protocol distributed algorithm that determines how nodes

share channel coordination for channel sharing also uses channel

itself no out-of-band channel for coordination

Link Layer 5-4

An ideal multiple access protocol

given broadcast channel of rate R bps

desired1 when one node wants to transmit it

can send at rate R2 when M nodes want to transmit each

can send at average rate RM3 fully decentralized

bull no special node to coordinate transmissions

bull no synchronization of clocks slots4 simple

Link Layer 5-5

MAC protocols classesThree broad classes channel partitioning

divide channel into smaller ldquopiecesrdquo (time frequency code slots)

allocate piece to node for exclusive use Time Division MA Frequency Division MA

random access channel not divided allow avoid collisions detect amp recover from collisions ALOHA S-ALOHA CSMA CSMACD CSMACA

ldquotaking turnsrdquo nodes take turns but nodes with more to send can take longer

turns polling from central site token passing bluetooth FDDI token ring

Link Layer 5-6

Channel partitioning MAC protocols TDMA

TDMA 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 LAN 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

Link Layer 5-7

FDMA 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 LAN 134 have pkt

frequency bands 256 idle fre

quen

cy b

ands

time

FDM cable

Channel partitioning MAC protocols FDMA

Link Layer 5-8

Random access 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 ldquocollisionrdquo

random access MAC protocol specifies how to detect avoid collisions how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

(pureunslotted) ALOHA slotted ALOHA CSMA CSMACD CSMACA

Link Layer 5-9

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability

frame sent at t0 collides with other frames sent in [t0-1t0]

Link Layer 5-10

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0 t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1) = f(p)

--- For maximum efficiency find p which maximize f(p) --- then assuming large systems let N max efficiency = 1(2e) = 18 at best channel

used for useful transmission 18 of time

Link Layer 5-11

Slotted ALOHAassumptions all frames same size time divided into equal size

slots (time to transmit 1 frame) nodes are synchronized nodes start to transmit only

at slot-beginning if 2 or more nodes transmit

in same 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

Link Layer 5-12

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

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-13

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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmission 37 of time

Slotted ALOHA efficiency

Link Layer 5-14

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 2: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-2

Multiple access links protocolsTwo types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch amp host

broadcast (shared wire or medium) Shared wire (coaxial) old-fashioned Ethernet Shared wireless (RF) 80211WiFi satellite

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

Link Layer 5-3

Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes

interfere collision if node receives two or more signals at the

same time

multiple access protocol distributed algorithm that determines how nodes

share channel coordination for channel sharing also uses channel

itself no out-of-band channel for coordination

Link Layer 5-4

An ideal multiple access protocol

given broadcast channel of rate R bps

desired1 when one node wants to transmit it

can send at rate R2 when M nodes want to transmit each

can send at average rate RM3 fully decentralized

bull no special node to coordinate transmissions

bull no synchronization of clocks slots4 simple

Link Layer 5-5

MAC protocols classesThree broad classes channel partitioning

divide channel into smaller ldquopiecesrdquo (time frequency code slots)

allocate piece to node for exclusive use Time Division MA Frequency Division MA

random access channel not divided allow avoid collisions detect amp recover from collisions ALOHA S-ALOHA CSMA CSMACD CSMACA

ldquotaking turnsrdquo nodes take turns but nodes with more to send can take longer

turns polling from central site token passing bluetooth FDDI token ring

Link Layer 5-6

Channel partitioning MAC protocols TDMA

TDMA 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 LAN 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

Link Layer 5-7

FDMA 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 LAN 134 have pkt

frequency bands 256 idle fre

quen

cy b

ands

time

FDM cable

Channel partitioning MAC protocols FDMA

Link Layer 5-8

Random access 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 ldquocollisionrdquo

random access MAC protocol specifies how to detect avoid collisions how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

(pureunslotted) ALOHA slotted ALOHA CSMA CSMACD CSMACA

Link Layer 5-9

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability

frame sent at t0 collides with other frames sent in [t0-1t0]

Link Layer 5-10

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0 t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1) = f(p)

--- For maximum efficiency find p which maximize f(p) --- then assuming large systems let N max efficiency = 1(2e) = 18 at best channel

used for useful transmission 18 of time

Link Layer 5-11

Slotted ALOHAassumptions all frames same size time divided into equal size

slots (time to transmit 1 frame) nodes are synchronized nodes start to transmit only

at slot-beginning if 2 or more nodes transmit

in same 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

Link Layer 5-12

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

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-13

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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmission 37 of time

Slotted ALOHA efficiency

Link Layer 5-14

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 3: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-3

Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes

interfere collision if node receives two or more signals at the

same time

multiple access protocol distributed algorithm that determines how nodes

share channel coordination for channel sharing also uses channel

itself no out-of-band channel for coordination

Link Layer 5-4

An ideal multiple access protocol

given broadcast channel of rate R bps

desired1 when one node wants to transmit it

can send at rate R2 when M nodes want to transmit each

can send at average rate RM3 fully decentralized

bull no special node to coordinate transmissions

bull no synchronization of clocks slots4 simple

Link Layer 5-5

MAC protocols classesThree broad classes channel partitioning

divide channel into smaller ldquopiecesrdquo (time frequency code slots)

allocate piece to node for exclusive use Time Division MA Frequency Division MA

random access channel not divided allow avoid collisions detect amp recover from collisions ALOHA S-ALOHA CSMA CSMACD CSMACA

ldquotaking turnsrdquo nodes take turns but nodes with more to send can take longer

turns polling from central site token passing bluetooth FDDI token ring

Link Layer 5-6

Channel partitioning MAC protocols TDMA

TDMA 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 LAN 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

Link Layer 5-7

FDMA 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 LAN 134 have pkt

frequency bands 256 idle fre

quen

cy b

ands

time

FDM cable

Channel partitioning MAC protocols FDMA

Link Layer 5-8

Random access 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 ldquocollisionrdquo

random access MAC protocol specifies how to detect avoid collisions how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

(pureunslotted) ALOHA slotted ALOHA CSMA CSMACD CSMACA

Link Layer 5-9

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability

frame sent at t0 collides with other frames sent in [t0-1t0]

Link Layer 5-10

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0 t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1) = f(p)

--- For maximum efficiency find p which maximize f(p) --- then assuming large systems let N max efficiency = 1(2e) = 18 at best channel

used for useful transmission 18 of time

Link Layer 5-11

Slotted ALOHAassumptions all frames same size time divided into equal size

slots (time to transmit 1 frame) nodes are synchronized nodes start to transmit only

at slot-beginning if 2 or more nodes transmit

in same 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

Link Layer 5-12

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

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-13

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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmission 37 of time

Slotted ALOHA efficiency

Link Layer 5-14

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 4: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-4

An ideal multiple access protocol

given broadcast channel of rate R bps

desired1 when one node wants to transmit it

can send at rate R2 when M nodes want to transmit each

can send at average rate RM3 fully decentralized

bull no special node to coordinate transmissions

bull no synchronization of clocks slots4 simple

Link Layer 5-5

MAC protocols classesThree broad classes channel partitioning

divide channel into smaller ldquopiecesrdquo (time frequency code slots)

allocate piece to node for exclusive use Time Division MA Frequency Division MA

random access channel not divided allow avoid collisions detect amp recover from collisions ALOHA S-ALOHA CSMA CSMACD CSMACA

ldquotaking turnsrdquo nodes take turns but nodes with more to send can take longer

turns polling from central site token passing bluetooth FDDI token ring

Link Layer 5-6

Channel partitioning MAC protocols TDMA

TDMA 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 LAN 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

Link Layer 5-7

FDMA 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 LAN 134 have pkt

frequency bands 256 idle fre

quen

cy b

ands

time

FDM cable

Channel partitioning MAC protocols FDMA

Link Layer 5-8

Random access 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 ldquocollisionrdquo

random access MAC protocol specifies how to detect avoid collisions how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

(pureunslotted) ALOHA slotted ALOHA CSMA CSMACD CSMACA

Link Layer 5-9

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability

frame sent at t0 collides with other frames sent in [t0-1t0]

Link Layer 5-10

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0 t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1) = f(p)

--- For maximum efficiency find p which maximize f(p) --- then assuming large systems let N max efficiency = 1(2e) = 18 at best channel

used for useful transmission 18 of time

Link Layer 5-11

Slotted ALOHAassumptions all frames same size time divided into equal size

slots (time to transmit 1 frame) nodes are synchronized nodes start to transmit only

at slot-beginning if 2 or more nodes transmit

in same 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

Link Layer 5-12

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

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-13

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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmission 37 of time

Slotted ALOHA efficiency

Link Layer 5-14

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 5: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-5

MAC protocols classesThree broad classes channel partitioning

divide channel into smaller ldquopiecesrdquo (time frequency code slots)

allocate piece to node for exclusive use Time Division MA Frequency Division MA

random access channel not divided allow avoid collisions detect amp recover from collisions ALOHA S-ALOHA CSMA CSMACD CSMACA

ldquotaking turnsrdquo nodes take turns but nodes with more to send can take longer

turns polling from central site token passing bluetooth FDDI token ring

Link Layer 5-6

Channel partitioning MAC protocols TDMA

TDMA 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 LAN 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

Link Layer 5-7

FDMA 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 LAN 134 have pkt

frequency bands 256 idle fre

quen

cy b

ands

time

FDM cable

Channel partitioning MAC protocols FDMA

Link Layer 5-8

Random access 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 ldquocollisionrdquo

random access MAC protocol specifies how to detect avoid collisions how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

(pureunslotted) ALOHA slotted ALOHA CSMA CSMACD CSMACA

Link Layer 5-9

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability

frame sent at t0 collides with other frames sent in [t0-1t0]

Link Layer 5-10

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0 t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1) = f(p)

--- For maximum efficiency find p which maximize f(p) --- then assuming large systems let N max efficiency = 1(2e) = 18 at best channel

used for useful transmission 18 of time

Link Layer 5-11

Slotted ALOHAassumptions all frames same size time divided into equal size

slots (time to transmit 1 frame) nodes are synchronized nodes start to transmit only

at slot-beginning if 2 or more nodes transmit

in same 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

Link Layer 5-12

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

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-13

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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmission 37 of time

Slotted ALOHA efficiency

Link Layer 5-14

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 6: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-6

Channel partitioning MAC protocols TDMA

TDMA 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 LAN 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

Link Layer 5-7

FDMA 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 LAN 134 have pkt

frequency bands 256 idle fre

quen

cy b

ands

time

FDM cable

Channel partitioning MAC protocols FDMA

Link Layer 5-8

Random access 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 ldquocollisionrdquo

random access MAC protocol specifies how to detect avoid collisions how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

(pureunslotted) ALOHA slotted ALOHA CSMA CSMACD CSMACA

Link Layer 5-9

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability

frame sent at t0 collides with other frames sent in [t0-1t0]

Link Layer 5-10

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0 t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1) = f(p)

--- For maximum efficiency find p which maximize f(p) --- then assuming large systems let N max efficiency = 1(2e) = 18 at best channel

used for useful transmission 18 of time

Link Layer 5-11

Slotted ALOHAassumptions all frames same size time divided into equal size

slots (time to transmit 1 frame) nodes are synchronized nodes start to transmit only

at slot-beginning if 2 or more nodes transmit

in same 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

Link Layer 5-12

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

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-13

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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmission 37 of time

Slotted ALOHA efficiency

Link Layer 5-14

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 7: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-7

FDMA 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 LAN 134 have pkt

frequency bands 256 idle fre

quen

cy b

ands

time

FDM cable

Channel partitioning MAC protocols FDMA

Link Layer 5-8

Random access 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 ldquocollisionrdquo

random access MAC protocol specifies how to detect avoid collisions how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

(pureunslotted) ALOHA slotted ALOHA CSMA CSMACD CSMACA

Link Layer 5-9

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability

frame sent at t0 collides with other frames sent in [t0-1t0]

Link Layer 5-10

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0 t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1) = f(p)

--- For maximum efficiency find p which maximize f(p) --- then assuming large systems let N max efficiency = 1(2e) = 18 at best channel

used for useful transmission 18 of time

Link Layer 5-11

Slotted ALOHAassumptions all frames same size time divided into equal size

slots (time to transmit 1 frame) nodes are synchronized nodes start to transmit only

at slot-beginning if 2 or more nodes transmit

in same 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

Link Layer 5-12

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

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-13

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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmission 37 of time

Slotted ALOHA efficiency

Link Layer 5-14

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 8: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-8

Random access 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 ldquocollisionrdquo

random access MAC protocol specifies how to detect avoid collisions how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

(pureunslotted) ALOHA slotted ALOHA CSMA CSMACD CSMACA

Link Layer 5-9

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability

frame sent at t0 collides with other frames sent in [t0-1t0]

Link Layer 5-10

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0 t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1) = f(p)

--- For maximum efficiency find p which maximize f(p) --- then assuming large systems let N max efficiency = 1(2e) = 18 at best channel

used for useful transmission 18 of time

Link Layer 5-11

Slotted ALOHAassumptions all frames same size time divided into equal size

slots (time to transmit 1 frame) nodes are synchronized nodes start to transmit only

at slot-beginning if 2 or more nodes transmit

in same 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

Link Layer 5-12

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

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-13

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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmission 37 of time

Slotted ALOHA efficiency

Link Layer 5-14

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 9: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-9

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability

frame sent at t0 collides with other frames sent in [t0-1t0]

Link Layer 5-10

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0 t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1) = f(p)

--- For maximum efficiency find p which maximize f(p) --- then assuming large systems let N max efficiency = 1(2e) = 18 at best channel

used for useful transmission 18 of time

Link Layer 5-11

Slotted ALOHAassumptions all frames same size time divided into equal size

slots (time to transmit 1 frame) nodes are synchronized nodes start to transmit only

at slot-beginning if 2 or more nodes transmit

in same 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

Link Layer 5-12

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

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-13

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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmission 37 of time

Slotted ALOHA efficiency

Link Layer 5-14

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 10: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-10

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0 t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1) = f(p)

--- For maximum efficiency find p which maximize f(p) --- then assuming large systems let N max efficiency = 1(2e) = 18 at best channel

used for useful transmission 18 of time

Link Layer 5-11

Slotted ALOHAassumptions all frames same size time divided into equal size

slots (time to transmit 1 frame) nodes are synchronized nodes start to transmit only

at slot-beginning if 2 or more nodes transmit

in same 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

Link Layer 5-12

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

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-13

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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmission 37 of time

Slotted ALOHA efficiency

Link Layer 5-14

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 11: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-11

Slotted ALOHAassumptions all frames same size time divided into equal size

slots (time to transmit 1 frame) nodes are synchronized nodes start to transmit only

at slot-beginning if 2 or more nodes transmit

in same 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

Link Layer 5-12

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

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-13

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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmission 37 of time

Slotted ALOHA efficiency

Link Layer 5-14

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 12: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-12

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

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-13

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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmission 37 of time

Slotted ALOHA efficiency

Link Layer 5-14

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 13: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-13

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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmission 37 of time

Slotted ALOHA efficiency

Link Layer 5-14

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 14: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-14

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 15: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-15

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each others transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 16: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-16

CSMACD (collision detection)CSMACD carrier sensing amp transmission

deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 17: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-17

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 18: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-18

Ethernet CSMACD algorithm1 NIC receives datagram

from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 19: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-19

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 20: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-20

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently amp fairly at high load inefficient at low load as 1N of bandwidth

allocated even if only one active node random access MAC protocols

efficient at low load single node can fully utilize channel

Inefficient at high load due to high collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 21: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-21

polling master node ldquoinvitesrdquo

slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 22: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-22

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 23: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-23

Topics Outline principles behind data link layer services

error detection correction sharing a broadcast channel multiple access link layer addressing amp ARP

instantiation and implementation of various link layer technologies Ethernet 80211 switched LANS VLANs virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 24: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-24

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 25: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-25

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 26: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-26

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC address

space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to another

IP hierarchical address not portable address depends on IP subnet to which node

is attached

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 27: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-27

ARP address resolution protocol ARP table each IP node (host router)

on LAN has this tableIPMAC address mapping for some LAN nodes lt IP address MAC address TTLgt

-TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Determines interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 28: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-28

ARP protocol within same LAN

A wants to send datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP

query packet containing Bs IP address dest MAC address = FF-

FF-FF-FF-FF-FF all nodes on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out) soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 29: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

Link Layer 5-29

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R (how) assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 30: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-30

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Arsquos MAC

address as source amp Rs MAC address as dest frame also contains A-to-B IP datagram

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 31: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

5-31

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 32: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-32

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with own MAC

address as source amp Bs MAC address () as dest

frame contains A-to-B IP datagramMAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
Page 33: Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-33

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

frame sent from R to B frame received at B datagram removed passed up to

IP

  • Module 13
  • Multiple access links protocols
  • Multiple access protocols
  • An ideal multiple access protocol
  • MAC protocols classes
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • Pure (unslotted) ALOHA
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 12
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • Slide 17
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 21
  • Slide 22
  • Topics Outline
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol within same LAN
  • Addressing routing to another LAN
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33