37
Link Layer 5-29 Ethernet CSMA/CD algorithm 1. 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 {0,1,2, …, 2 m -1}. NIC waits K·512 bit times, returns to Step 2 § longer backoff interval with more collisions

Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

  • Upload
    others

  • View
    36

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-29

Ethernet CSMACD algorithm

1 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 sect  after mth collision NIC

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

sect  longer backoff interval with more collisions

Link Layer 5-30

CSMACD efficiency

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

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

v  better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

Link Layer 5-31

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols sect  share channel efficiently and fairly at high load sect  inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols

sect  efficient at low load single node can fully utilize channel

sect  high load collision overhead ldquotaking turnsrdquo protocols

look for best of both worlds

Link Layer 5-32

polling v  master node ldquoinvitesrdquo

slave nodes to transmit in turn

v  typically used with ldquodumbrdquo slave devices

v  concerns sect  polling overhead sect  latency sect  single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-33

token passing v  control token passed

from one node to next sequentially

v  token message v  concerns

sect  token overhead sect  latency sect  single point of failure

(token)

T

data

(nothing to send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-34

Summary of MAC protocols

v  channel partitioning by time frequency or code sect  Time Division Frequency Division

v  random access (dynamic) sect  ALOHA S-ALOHA CSMA CSMACD sect  carrier sensing easy in some technologies (wire) hard

in others (wireless) sect  CSMACD used in Ethernet sect  CSMACA used in 80211

v  taking turns sect  polling from central site token passing sect  bluetooth FDDI token ring

Link Layer 5-35

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-36

Ethernet ldquodominantrdquo wired LAN technology v  cheap $20 for NIC v  first widely used LAN technology v  simpler cheaper than token LANs and ATM v  kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Link Layer 5-37

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-38

Ethernet frame structure

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble v  7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 v  used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-39

Ethernet frame structure (more) v  addresses 6 byte source destination MAC addresses

sect  if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

sect  otherwise adapter discards frame v  type indicates higher layer protocol (mostly IP but

others possible eg Novell IPX AppleTalk) v  CRC cyclic redundancy check at receiver

sect  error detected frame is dropped

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-40

Ethernet unreliable connectionless

v  connectionless no handshaking between sending and receiving NICs

v  unreliable receiving NIC doesnt send acks or nacks to sending NIC sect  data in dropped frames recovered only if initial

sender uses higher layer rdt (eg TCP) otherwise dropped data lost

v  Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

5 DataLink Layer 5-41

Ethernet uses CSMACD v  No slots v  adapter doesnrsquot transmit

if it senses that some other adapter is transmitting that is carrier sense

v  transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

v  Before attempting a retransmission adapter waits a random time that is random access

5 DataLink Layer 5-42

Ethernet CSMACD algorithm 1 Adaptor receives

datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

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

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

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 2: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-30

CSMACD efficiency

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

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

v  better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

Link Layer 5-31

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols sect  share channel efficiently and fairly at high load sect  inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols

sect  efficient at low load single node can fully utilize channel

sect  high load collision overhead ldquotaking turnsrdquo protocols

look for best of both worlds

Link Layer 5-32

polling v  master node ldquoinvitesrdquo

slave nodes to transmit in turn

v  typically used with ldquodumbrdquo slave devices

v  concerns sect  polling overhead sect  latency sect  single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-33

token passing v  control token passed

from one node to next sequentially

v  token message v  concerns

sect  token overhead sect  latency sect  single point of failure

(token)

T

data

(nothing to send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-34

Summary of MAC protocols

v  channel partitioning by time frequency or code sect  Time Division Frequency Division

v  random access (dynamic) sect  ALOHA S-ALOHA CSMA CSMACD sect  carrier sensing easy in some technologies (wire) hard

in others (wireless) sect  CSMACD used in Ethernet sect  CSMACA used in 80211

v  taking turns sect  polling from central site token passing sect  bluetooth FDDI token ring

Link Layer 5-35

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-36

Ethernet ldquodominantrdquo wired LAN technology v  cheap $20 for NIC v  first widely used LAN technology v  simpler cheaper than token LANs and ATM v  kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Link Layer 5-37

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-38

Ethernet frame structure

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble v  7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 v  used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-39

Ethernet frame structure (more) v  addresses 6 byte source destination MAC addresses

sect  if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

sect  otherwise adapter discards frame v  type indicates higher layer protocol (mostly IP but

others possible eg Novell IPX AppleTalk) v  CRC cyclic redundancy check at receiver

sect  error detected frame is dropped

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-40

Ethernet unreliable connectionless

v  connectionless no handshaking between sending and receiving NICs

v  unreliable receiving NIC doesnt send acks or nacks to sending NIC sect  data in dropped frames recovered only if initial

sender uses higher layer rdt (eg TCP) otherwise dropped data lost

v  Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

5 DataLink Layer 5-41

Ethernet uses CSMACD v  No slots v  adapter doesnrsquot transmit

if it senses that some other adapter is transmitting that is carrier sense

v  transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

v  Before attempting a retransmission adapter waits a random time that is random access

5 DataLink Layer 5-42

Ethernet CSMACD algorithm 1 Adaptor receives

datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

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

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

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 3: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-31

ldquoTaking turnsrdquo MAC protocols

channel partitioning MAC protocols sect  share channel efficiently and fairly at high load sect  inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols

sect  efficient at low load single node can fully utilize channel

sect  high load collision overhead ldquotaking turnsrdquo protocols

look for best of both worlds

Link Layer 5-32

polling v  master node ldquoinvitesrdquo

slave nodes to transmit in turn

v  typically used with ldquodumbrdquo slave devices

v  concerns sect  polling overhead sect  latency sect  single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-33

token passing v  control token passed

from one node to next sequentially

v  token message v  concerns

sect  token overhead sect  latency sect  single point of failure

(token)

T

data

(nothing to send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-34

Summary of MAC protocols

v  channel partitioning by time frequency or code sect  Time Division Frequency Division

v  random access (dynamic) sect  ALOHA S-ALOHA CSMA CSMACD sect  carrier sensing easy in some technologies (wire) hard

in others (wireless) sect  CSMACD used in Ethernet sect  CSMACA used in 80211

v  taking turns sect  polling from central site token passing sect  bluetooth FDDI token ring

Link Layer 5-35

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-36

Ethernet ldquodominantrdquo wired LAN technology v  cheap $20 for NIC v  first widely used LAN technology v  simpler cheaper than token LANs and ATM v  kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Link Layer 5-37

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-38

Ethernet frame structure

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble v  7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 v  used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-39

Ethernet frame structure (more) v  addresses 6 byte source destination MAC addresses

sect  if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

sect  otherwise adapter discards frame v  type indicates higher layer protocol (mostly IP but

others possible eg Novell IPX AppleTalk) v  CRC cyclic redundancy check at receiver

sect  error detected frame is dropped

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-40

Ethernet unreliable connectionless

v  connectionless no handshaking between sending and receiving NICs

v  unreliable receiving NIC doesnt send acks or nacks to sending NIC sect  data in dropped frames recovered only if initial

sender uses higher layer rdt (eg TCP) otherwise dropped data lost

v  Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

5 DataLink Layer 5-41

Ethernet uses CSMACD v  No slots v  adapter doesnrsquot transmit

if it senses that some other adapter is transmitting that is carrier sense

v  transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

v  Before attempting a retransmission adapter waits a random time that is random access

5 DataLink Layer 5-42

Ethernet CSMACD algorithm 1 Adaptor receives

datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

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

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

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 4: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-32

polling v  master node ldquoinvitesrdquo

slave nodes to transmit in turn

v  typically used with ldquodumbrdquo slave devices

v  concerns sect  polling overhead sect  latency sect  single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-33

token passing v  control token passed

from one node to next sequentially

v  token message v  concerns

sect  token overhead sect  latency sect  single point of failure

(token)

T

data

(nothing to send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-34

Summary of MAC protocols

v  channel partitioning by time frequency or code sect  Time Division Frequency Division

v  random access (dynamic) sect  ALOHA S-ALOHA CSMA CSMACD sect  carrier sensing easy in some technologies (wire) hard

in others (wireless) sect  CSMACD used in Ethernet sect  CSMACA used in 80211

v  taking turns sect  polling from central site token passing sect  bluetooth FDDI token ring

Link Layer 5-35

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-36

Ethernet ldquodominantrdquo wired LAN technology v  cheap $20 for NIC v  first widely used LAN technology v  simpler cheaper than token LANs and ATM v  kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Link Layer 5-37

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-38

Ethernet frame structure

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble v  7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 v  used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-39

Ethernet frame structure (more) v  addresses 6 byte source destination MAC addresses

sect  if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

sect  otherwise adapter discards frame v  type indicates higher layer protocol (mostly IP but

others possible eg Novell IPX AppleTalk) v  CRC cyclic redundancy check at receiver

sect  error detected frame is dropped

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-40

Ethernet unreliable connectionless

v  connectionless no handshaking between sending and receiving NICs

v  unreliable receiving NIC doesnt send acks or nacks to sending NIC sect  data in dropped frames recovered only if initial

sender uses higher layer rdt (eg TCP) otherwise dropped data lost

v  Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

5 DataLink Layer 5-41

Ethernet uses CSMACD v  No slots v  adapter doesnrsquot transmit

if it senses that some other adapter is transmitting that is carrier sense

v  transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

v  Before attempting a retransmission adapter waits a random time that is random access

5 DataLink Layer 5-42

Ethernet CSMACD algorithm 1 Adaptor receives

datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

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

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

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 5: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-33

token passing v  control token passed

from one node to next sequentially

v  token message v  concerns

sect  token overhead sect  latency sect  single point of failure

(token)

T

data

(nothing to send)

T

ldquoTaking turnsrdquo MAC protocols

Link Layer 5-34

Summary of MAC protocols

v  channel partitioning by time frequency or code sect  Time Division Frequency Division

v  random access (dynamic) sect  ALOHA S-ALOHA CSMA CSMACD sect  carrier sensing easy in some technologies (wire) hard

in others (wireless) sect  CSMACD used in Ethernet sect  CSMACA used in 80211

v  taking turns sect  polling from central site token passing sect  bluetooth FDDI token ring

Link Layer 5-35

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-36

Ethernet ldquodominantrdquo wired LAN technology v  cheap $20 for NIC v  first widely used LAN technology v  simpler cheaper than token LANs and ATM v  kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Link Layer 5-37

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-38

Ethernet frame structure

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble v  7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 v  used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-39

Ethernet frame structure (more) v  addresses 6 byte source destination MAC addresses

sect  if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

sect  otherwise adapter discards frame v  type indicates higher layer protocol (mostly IP but

others possible eg Novell IPX AppleTalk) v  CRC cyclic redundancy check at receiver

sect  error detected frame is dropped

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-40

Ethernet unreliable connectionless

v  connectionless no handshaking between sending and receiving NICs

v  unreliable receiving NIC doesnt send acks or nacks to sending NIC sect  data in dropped frames recovered only if initial

sender uses higher layer rdt (eg TCP) otherwise dropped data lost

v  Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

5 DataLink Layer 5-41

Ethernet uses CSMACD v  No slots v  adapter doesnrsquot transmit

if it senses that some other adapter is transmitting that is carrier sense

v  transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

v  Before attempting a retransmission adapter waits a random time that is random access

5 DataLink Layer 5-42

Ethernet CSMACD algorithm 1 Adaptor receives

datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

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

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

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 6: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-34

Summary of MAC protocols

v  channel partitioning by time frequency or code sect  Time Division Frequency Division

v  random access (dynamic) sect  ALOHA S-ALOHA CSMA CSMACD sect  carrier sensing easy in some technologies (wire) hard

in others (wireless) sect  CSMACD used in Ethernet sect  CSMACA used in 80211

v  taking turns sect  polling from central site token passing sect  bluetooth FDDI token ring

Link Layer 5-35

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-36

Ethernet ldquodominantrdquo wired LAN technology v  cheap $20 for NIC v  first widely used LAN technology v  simpler cheaper than token LANs and ATM v  kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Link Layer 5-37

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-38

Ethernet frame structure

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble v  7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 v  used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-39

Ethernet frame structure (more) v  addresses 6 byte source destination MAC addresses

sect  if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

sect  otherwise adapter discards frame v  type indicates higher layer protocol (mostly IP but

others possible eg Novell IPX AppleTalk) v  CRC cyclic redundancy check at receiver

sect  error detected frame is dropped

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-40

Ethernet unreliable connectionless

v  connectionless no handshaking between sending and receiving NICs

v  unreliable receiving NIC doesnt send acks or nacks to sending NIC sect  data in dropped frames recovered only if initial

sender uses higher layer rdt (eg TCP) otherwise dropped data lost

v  Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

5 DataLink Layer 5-41

Ethernet uses CSMACD v  No slots v  adapter doesnrsquot transmit

if it senses that some other adapter is transmitting that is carrier sense

v  transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

v  Before attempting a retransmission adapter waits a random time that is random access

5 DataLink Layer 5-42

Ethernet CSMACD algorithm 1 Adaptor receives

datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

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

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

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 7: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-35

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-36

Ethernet ldquodominantrdquo wired LAN technology v  cheap $20 for NIC v  first widely used LAN technology v  simpler cheaper than token LANs and ATM v  kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Link Layer 5-37

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-38

Ethernet frame structure

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble v  7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 v  used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-39

Ethernet frame structure (more) v  addresses 6 byte source destination MAC addresses

sect  if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

sect  otherwise adapter discards frame v  type indicates higher layer protocol (mostly IP but

others possible eg Novell IPX AppleTalk) v  CRC cyclic redundancy check at receiver

sect  error detected frame is dropped

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-40

Ethernet unreliable connectionless

v  connectionless no handshaking between sending and receiving NICs

v  unreliable receiving NIC doesnt send acks or nacks to sending NIC sect  data in dropped frames recovered only if initial

sender uses higher layer rdt (eg TCP) otherwise dropped data lost

v  Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

5 DataLink Layer 5-41

Ethernet uses CSMACD v  No slots v  adapter doesnrsquot transmit

if it senses that some other adapter is transmitting that is carrier sense

v  transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

v  Before attempting a retransmission adapter waits a random time that is random access

5 DataLink Layer 5-42

Ethernet CSMACD algorithm 1 Adaptor receives

datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

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

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

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 8: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-36

Ethernet ldquodominantrdquo wired LAN technology v  cheap $20 for NIC v  first widely used LAN technology v  simpler cheaper than token LANs and ATM v  kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Link Layer 5-37

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-38

Ethernet frame structure

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble v  7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 v  used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-39

Ethernet frame structure (more) v  addresses 6 byte source destination MAC addresses

sect  if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

sect  otherwise adapter discards frame v  type indicates higher layer protocol (mostly IP but

others possible eg Novell IPX AppleTalk) v  CRC cyclic redundancy check at receiver

sect  error detected frame is dropped

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-40

Ethernet unreliable connectionless

v  connectionless no handshaking between sending and receiving NICs

v  unreliable receiving NIC doesnt send acks or nacks to sending NIC sect  data in dropped frames recovered only if initial

sender uses higher layer rdt (eg TCP) otherwise dropped data lost

v  Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

5 DataLink Layer 5-41

Ethernet uses CSMACD v  No slots v  adapter doesnrsquot transmit

if it senses that some other adapter is transmitting that is carrier sense

v  transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

v  Before attempting a retransmission adapter waits a random time that is random access

5 DataLink Layer 5-42

Ethernet CSMACD algorithm 1 Adaptor receives

datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

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

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

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 9: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-37

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-38

Ethernet frame structure

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble v  7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 v  used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-39

Ethernet frame structure (more) v  addresses 6 byte source destination MAC addresses

sect  if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

sect  otherwise adapter discards frame v  type indicates higher layer protocol (mostly IP but

others possible eg Novell IPX AppleTalk) v  CRC cyclic redundancy check at receiver

sect  error detected frame is dropped

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-40

Ethernet unreliable connectionless

v  connectionless no handshaking between sending and receiving NICs

v  unreliable receiving NIC doesnt send acks or nacks to sending NIC sect  data in dropped frames recovered only if initial

sender uses higher layer rdt (eg TCP) otherwise dropped data lost

v  Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

5 DataLink Layer 5-41

Ethernet uses CSMACD v  No slots v  adapter doesnrsquot transmit

if it senses that some other adapter is transmitting that is carrier sense

v  transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

v  Before attempting a retransmission adapter waits a random time that is random access

5 DataLink Layer 5-42

Ethernet CSMACD algorithm 1 Adaptor receives

datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

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

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

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 10: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-38

Ethernet frame structure

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble v  7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 v  used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-39

Ethernet frame structure (more) v  addresses 6 byte source destination MAC addresses

sect  if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

sect  otherwise adapter discards frame v  type indicates higher layer protocol (mostly IP but

others possible eg Novell IPX AppleTalk) v  CRC cyclic redundancy check at receiver

sect  error detected frame is dropped

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-40

Ethernet unreliable connectionless

v  connectionless no handshaking between sending and receiving NICs

v  unreliable receiving NIC doesnt send acks or nacks to sending NIC sect  data in dropped frames recovered only if initial

sender uses higher layer rdt (eg TCP) otherwise dropped data lost

v  Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

5 DataLink Layer 5-41

Ethernet uses CSMACD v  No slots v  adapter doesnrsquot transmit

if it senses that some other adapter is transmitting that is carrier sense

v  transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

v  Before attempting a retransmission adapter waits a random time that is random access

5 DataLink Layer 5-42

Ethernet CSMACD algorithm 1 Adaptor receives

datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

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

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

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 11: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-39

Ethernet frame structure (more) v  addresses 6 byte source destination MAC addresses

sect  if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

sect  otherwise adapter discards frame v  type indicates higher layer protocol (mostly IP but

others possible eg Novell IPX AppleTalk) v  CRC cyclic redundancy check at receiver

sect  error detected frame is dropped

dest address

source address

data (payload) CRC preamble

type

Link Layer 5-40

Ethernet unreliable connectionless

v  connectionless no handshaking between sending and receiving NICs

v  unreliable receiving NIC doesnt send acks or nacks to sending NIC sect  data in dropped frames recovered only if initial

sender uses higher layer rdt (eg TCP) otherwise dropped data lost

v  Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

5 DataLink Layer 5-41

Ethernet uses CSMACD v  No slots v  adapter doesnrsquot transmit

if it senses that some other adapter is transmitting that is carrier sense

v  transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

v  Before attempting a retransmission adapter waits a random time that is random access

5 DataLink Layer 5-42

Ethernet CSMACD algorithm 1 Adaptor receives

datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

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

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

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 12: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-40

Ethernet unreliable connectionless

v  connectionless no handshaking between sending and receiving NICs

v  unreliable receiving NIC doesnt send acks or nacks to sending NIC sect  data in dropped frames recovered only if initial

sender uses higher layer rdt (eg TCP) otherwise dropped data lost

v  Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

5 DataLink Layer 5-41

Ethernet uses CSMACD v  No slots v  adapter doesnrsquot transmit

if it senses that some other adapter is transmitting that is carrier sense

v  transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

v  Before attempting a retransmission adapter waits a random time that is random access

5 DataLink Layer 5-42

Ethernet CSMACD algorithm 1 Adaptor receives

datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

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

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

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 13: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

5 DataLink Layer 5-41

Ethernet uses CSMACD v  No slots v  adapter doesnrsquot transmit

if it senses that some other adapter is transmitting that is carrier sense

v  transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

v  Before attempting a retransmission adapter waits a random time that is random access

5 DataLink Layer 5-42

Ethernet CSMACD algorithm 1 Adaptor receives

datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

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

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

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 14: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

5 DataLink Layer 5-42

Ethernet CSMACD algorithm 1 Adaptor receives

datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

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

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

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 15: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

5 DataLink Layer 5-43

Question v  Is it possible that

A collision happens in Ethernet But is not detected at the MAC layer

Remember CSMACD does not use MAC layer ACKs

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 16: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

5 DataLink Layer 5-44

Ethernetrsquos CSMACD (more) Jam Signal make sure all

other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff v  Goal adapt retransmission

attempts to estimated current load sect  heavy load random wait

will be longer v  first collision choose K

from 01 delay is K 512 bit transmission times

v  after second collision choose K from 0123hellip

v  after ten collisions choose K from 01234hellip1023

Seeinteract with Java applet on AWL Web site highly recommended

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 17: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-45

8023 Ethernet standards link amp physical layers

v  many different Ethernet standards sect  common MAC protocol and frame format sect  different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bps sect  different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 18: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-46

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 19: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-47

MAC addresses and ARP

v  32-bit IP address sect  network-layer address for interface sect  used for layer 3 (network layer) forwarding

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

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

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

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

hexadecimal (base 16) notation (each ldquonumberrdquo represents 4 bits)

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 20: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-48

LAN addresses and ARP each 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 or wireless)

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 21: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-49

LAN addresses (more)

v  MAC address allocation administered by IEEE v  manufacturer buys portion of MAC address space

(to assure uniqueness) v  analogy

sect  MAC address like Social Security Number sect  IP address like postal address

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

v  IP hierarchical address not portable sect  address depends on IP subnet to which node is

attached

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 22: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-50

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

sect  IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how to determine 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-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 23: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-51

ARP protocol same LAN v  A wants to send datagram

to B sect  Brsquos MAC address not in

Arsquos ARP table v  A broadcasts ARP query

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

FF-FF-FF-FF sect  all nodes on LAN receive

ARP query v  B receives ARP packet

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

address (unicast)

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

times out (goes away) unless refreshed

v  ARP is ldquoplug-and-playrdquo sect  nodes create their ARP

tables without intervention from net administrator

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 24: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-52

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

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 25: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-53

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

v  A creates IP datagram with IP source A destination B v  A creates link-layer frame with Rs MAC address as dest frame

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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 26: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-54

Addressing routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  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-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 27: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-55

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 28: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-56

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP

Eth Phy

IP Eth Phy

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 29: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

R

1A-23-F9-CD-06-9B 222222222220

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

111111111112

111111111111 74-29-9C-E8-FF-55

A

222222222222 49-BD-D2-C7-56-2A

222222222221 88-B2-2F-54-1A-0F

B

Link Layer 5-57

Addressing routing to another LAN v  R forwards datagram with IP source A destination B v  R creates link-layer frame with Bs MAC address as dest frame

contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 30: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-58

Link layer LANs outline

51 introduction services 52 error detection

correction 53 multiple access

protocols 54 LANs

sect  addressing ARP sect  Ethernet sect  switches sect  VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 31: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-59

Ethernet physical topology v  bus popular through mid 90s

sect  all nodes in same collision domain (can collide with each other)

v  star prevails today sect  active switch in center sect  each ldquospokerdquo runs a (separate) Ethernet protocol (nodes

do not collide with each other)

switch

bus coaxial cable star

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 32: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-60

Ethernet switch v  link-layer device takes an active role

sect  store forward Ethernet frames sect  examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

v  transparent sect  hosts are unaware of presence of switches

v  plug-and-play self-learning sect  switches do not need to be configured

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 33: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-61

Switch multiple simultaneous transmissions

v  hosts have dedicated direct connection to switch

v  switches buffer packets v  Ethernet protocol used on each

incoming link but no collisions full duplex sect  each link is its own collision

domain v  switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 34: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-62

Switch forwarding table

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6 v  A each switch has a switch table each entry sect  (MAC address of host interface to

reach host time stamp) sect  looks like a routing table

Q how are entries created maintained in switch table

sect  something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 35: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-63

Switch self-learning v  switch learns which hosts

can be reached through which interfaces sect  when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

sect  records senderlocation pair in switch table

A Arsquo

Source A Dest Arsquo

MAC addr interface TTL Switch table

(initially empty) A 1 60

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 36: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

Link Layer 5-64

Switch frame filteringforwarding

when frame received at switch 1 record incoming link MAC address of sending host 2 index switch table using MAC destination address 3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link

Page 37: Ethernet CSMA/CD algorithmcontents.kocw.net/KOCW/document/2015/hanyang_erica/leesukbok1/14-2.pdf · § ALOHA, S-ALOHA, CSMA, CSMA/CD § carrier sensing: easy in some technologies

A

Arsquo

B

Brsquo C

Crsquo

1 2

3 4 5

6

Link Layer 5-65

Self-learning forwarding example A Arsquo

Source A Dest Arsquo

MAC addr interface TTL switch table

(initially empty) A 1 60

A Arsquo A Arsquo A Arsquo A Arsquo A Arsquo

v  frame destination Arsquo locaton unknown flood

Arsquo A

v  destination A location known

Arsquo 4 60

selectively send on just one link