data link layer “taking turns” mac protocolsyzhu /courses/comnet/slides/lec23.pdfdata link layer...

7
9 Data Link Layer “Taking Turns” MAC protocols Polling: master node “invites” slave nodes to transmit in turn typically used with “dumb” slave devices concerns: polling overhead latency single point of failure (master) master slaves poll data data Data Link Layer 49 Data Link Layer “Taking Turns” MAC protocols Token passing: control token passed from one node to next sequentially. token message concerns: token overhead latency single point of failure (token) T data (nothing to send) T Data Link Layer 50 Data Link Layer Summary of MAC protocols channel partitioning, by time, frequency Time Division, Frequency Division random access ALOHA, S-ALOHA, CSMA, CSMA/CD Collision detection: easy in some technologies (wire), hard in others (wireless) CSMA/CD used in Ethernet CSMA/CA used in 802.11 taking turns polling from central site, token passing Bluetooth, FDDI, IBM Token Ring Data Link Layer 51 Data Link Layer Link Layer 1 Link Layer and services 2 Error detection and correction 3 Multiple access protocols 4 Link-layer addressing 5 Ethernet 6 Link-layer switches 7 Link virtualization: ATM Data Link Layer 52 Data Link Layer MAC Addresses 32-bit IP address: network-layer address used to get datagram to destination IP subnet MAC (or LAN or physical or Ethernet) address: function: get frame from one interface to another physically-connected interface (same network) 48 bit MAC address (for most LANs) burned in NIC ROM, also sometimes software settable Permanent, globally unique Data Link Layer 53 Data Link Layer LAN Addresses Each adapter on LAN has unique LAN address Broadcast address = FF-FF-FF-FF-FF-FF = 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) Data Link Layer 54

Upload: others

Post on 02-Apr-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Link Layer “Taking Turns” MAC protocolsyzhu /courses/comnet/slides/Lec23.pdfData Link Layer 49 Data Link Layer “Taking Turns” MAC protocols Token passing: control token

9

Data Link Layer

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead

latency

single point of failure (master)

master

slaves

poll

data

data

Data Link Layer 49

Data Link Layer

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message

concernstoken overhead

latency

single point of failure (token)

T

data

(nothing

to send)

T

Data Link Layer 50

Data Link Layer

Summary of MAC protocols

channel partitioning by time frequency Time Division Frequency Division

random access ALOHA S-ALOHA CSMA CSMACD

Collision detection easy in some technologies (wire) hard in others (wireless)

CSMACD used in Ethernet

CSMACA used in 80211

taking turns polling from central site token passing

Bluetooth FDDI IBM Token Ring

Data Link Layer 51

Data Link Layer

Link Layer

1 Link Layer and services

2 Error detection and correction

3 Multiple access protocols

4 Link-layer addressing

5 Ethernet

6 Link-layer switches

7 Link virtualization ATM

Data Link Layer 52

Data Link Layer

MAC Addresses

32-bit IP address network-layer address

used to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) address function get frame from one interface to another

physically-connected interface (same network)

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

Permanent globally uniqueData Link Layer 53

Data Link Layer

LAN Addresses

Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

Data Link Layer 54

10

Data Link Layer

LAN Address (more)

MAC address allocation administered by IEEE

manufacturer buys portion of MAC address space (to assure uniqueness)

analogy

(a) MAC address like Social Security Number

(b) IP address like postal address

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

IP hierarchical address NOT portable address depends on IP subnet to which node is attached

Data Link Layer 55

Data Link Layer

Why both MAC and IP address

Answer to keep the layers independent

(1) The data link layer does not only serve IP protocol including many others

(2) if adapters use network-layer address then the adapter needs to be reconfigured every time it moves

(3) if not use MAC add at all then all received frames should be forwarded to network layer Great overhead

Data Link Layer 56

Data Link Layer

ARP Address Resolution Protocol

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

ARP table IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how does A determineMAC address of Bknowing Brsquos 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

A

BData Link Layer 57

Data Link Layer

Arp table on each node

Data Link Layer 58

Data Link Layer

How ARP works Case 1 Same LAN

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP table

A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

B receives ARP packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

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

soft state information that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Data Link Layer 59

Data Link Layer

How ARP works Case 2 routing to another LAN

Data Link Layer 60

R

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

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A

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

222222222221

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

B222222222222

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

two ARP tables in router R one for each IP network (LAN)

walkthrough send datagram from A to B via Rassume A knows Brsquos IP address

11

Data Link Layer

A creates IP datagram with source A destination B

A uses ARP to get Rrsquos MAC address for 111111111110

A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagram

Arsquos NIC sends frame

Rrsquos NIC receives frame

R removes IP datagram from Ethernet frame sees its destined to B

R uses ARP to get Brsquos MAC address

R creates frame containing A-to-B IP datagram sends to B

R

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

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A

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

222222222221

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

B222222222222

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

Data Link Layer 61

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-62

Illustration

IP

Eth

Phy

IP src 111111111111

IP dest 222222222222

A creates IP datagram with IP source A destination B

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

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-63

Illustration

IP

Eth

Phy

frame sent from A to R

IP

Eth

Phy

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

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-64

Illustration

IP src 111111111111

IP dest 222222222222

R forwards datagram with IP source A destination B

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

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-65

Illustration R forwards datagram with IP source A destination B

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

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-66

Illustration R forwards datagram with IP source A destination B

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

1

Data Link Layer

Home network

Institutional network

Mobile network

Global ISP

Regional ISP

Data Link Layer (Part B)

Yanmin Zhu

Department of Computer Science and Engineering

COMNETS CSE 1

Data Link Layer

Link Layer

1 Introduction and services

2 Error detection and correction

3 Multiple access protocols

4 Link-layer Addressing

5 Ethernet

6 Link-layer switches

7 Link virtualization ATM

COMNETS CSE 2

Data Link Layer

Ethernet

ldquodominantrdquo wired LAN technology

cheap $20 for NIC

first widely used LAN technology

simpler cheaper than token LANs and ATM

kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet

sketch

COMNETS CSE 3

Data Link Layer

Inventors of Ethernet

Robert Metcalfe PhD Harvard

1973

David Boggs PhD Stanford

1982

Mr Metcalfe generating the ideas

Mr Boggs figuring out how to build the system

COMNETS CSE 4

David Boggs Robert Metcalfe

Data Link Layer

Xerox PARC

Ethernet

Laser Printing

GUI

Object-oriented Programming (SmallTalk)

WYSIWYG

helliphellip

COMNETS CSE 5

Data Link Layer

Metcalfes law

Value of a telecommunications network is proportional to the square of the number of connected users of the system (n2)

COMNETS CSE 6

2

Data Link Layer

Bus Topology

Old fashioned Based on Coax Bus topology popular through mid 90s

bus coaxial cable

COMNETS CSE 7

Data Link Layer

Star topology

today star topology prevailsactive switch in centereach ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

star

COMNETS CSE 8

Data Link Layer

Ethernet Frame Structure

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

Preamble

7 bytes with pattern 10101010 followed by one byte with pattern 10101011

used to synchronize receiver sender clock rates

COMNETS CSE 9

Data Link Layer

Ethernet Frame Structure (more)

Addresses 6 bytes if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

otherwise adapter discards frame

Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

CRC checked at receiver if error is detected frame is dropped

multiplexing COMNETS CSE 10

Data Link Layer

Ethernet Unreliable connectionless

connectionless No handshaking between sending and receiving NICs

unreliable receiving NIC doesnrsquot send acks or nacks to sending NIC stream of datagrams passed to network layer can have gaps

(missing datagrams)

gaps will be filled if app is using TCP

otherwise app will see gaps

Ethernetrsquos MAC protocol unslotted CSMACD

COMNETS CSE 11

Data Link Layer

Ethernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 Carrier sensing If NIC senses channel idle starts frame

transmission

If NIC senses channel busy waits until channel idle then transmits

COMNETS CSE 12

3

Data Link Layer

Ethernet CSMACD algorithm (2)

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

After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2 demo

COMNETS CSE 13

Data Link Layer

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

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

Exponential Backoff Goal adapt retransmission

attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on AWL Web sitehighly recommended

COMNETS CSE 14

httpmediapearsoncmgcomawaw_kurose_networ

k_2appletscsmacdcsmacdhtml

Data Link Layer

Why Exponential

When there are a small number of competitors resolve completion in short time =gt wait a short time

When there are a larger number of competitors resolve completion in longer time

When experiencing more collisions be aware of more competitors

COMNETS CSE 15

Data Link Layer

CSMACD efficiency

Tprop = max prop delay between 2 nodes in LAN

ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0

as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

51

1

COMNETS CSE 16

Data Link Layer

Minimum Frame Length

(1) To make it easier to distinguish valid frames from garbage Ethernet requires that valid frames must be at least 64 bytes long from destination address to checksum

(2) Another is to prevent a station from completing the transmission of a short frame before a potential collision could be detected

COMNETS CSE 17

Data Link Layer

What is the longest delay for A detecting the collision from B after Arsquos transmission of data

Minimum Frame Length (64 bytes)

COMNETS CSE 18

4

Data Link Layer

All frames must take more than 2τ to send so that the transmission is still taking place when the noise burst gets back to the sender in the worst case

Minimum Frame Length (64 bytes)

COMNETS CSE 19

Data Link Layer

Minimum Frame Length (64 bytes)

min

min

2

2 2

F

B

lF B B

v

2 Collision detection can take as long as

COMNETS CSE 20

Data Link Layer

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bps different physical layer media fiber cable

application

transport

network

link

physical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister

pair) physical layer COMNETS CSE 21

Data Link Layer

Manchester encoding

used in 10BaseT

each bit has a transition

allows clocks in sending and receiving nodes to synchronize to each other no need for a centralized global clock among nodes

Hey this is physical-layer stuff

COMNETS CSE 22

Data Link Layer

Development of Ethernet

1973

Invented

Fast Ethernet

IEEE 8023u

1995 1998

Giga Ethernet

IEEE 8023z

2003

10g Ethernet

IEEE 8023ae

1983

IEEE 8023

(thick coax)

COMNETS CSE 23

Data Link Layer

Link Layer

1 Introduction and services

2 Error detection and correction

3 Multiple access protocols

4 Link-layer Addressing

5 Ethernet

6 Link-layer switches

7 Link virtualization ATM

COMNETS CSE 24

Page 2: Data Link Layer “Taking Turns” MAC protocolsyzhu /courses/comnet/slides/Lec23.pdfData Link Layer 49 Data Link Layer “Taking Turns” MAC protocols Token passing: control token

10

Data Link Layer

LAN Address (more)

MAC address allocation administered by IEEE

manufacturer buys portion of MAC address space (to assure uniqueness)

analogy

(a) MAC address like Social Security Number

(b) IP address like postal address

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

IP hierarchical address NOT portable address depends on IP subnet to which node is attached

Data Link Layer 55

Data Link Layer

Why both MAC and IP address

Answer to keep the layers independent

(1) The data link layer does not only serve IP protocol including many others

(2) if adapters use network-layer address then the adapter needs to be reconfigured every time it moves

(3) if not use MAC add at all then all received frames should be forwarded to network layer Great overhead

Data Link Layer 56

Data Link Layer

ARP Address Resolution Protocol

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

ARP table IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

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

Question how does A determineMAC address of Bknowing Brsquos 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

A

BData Link Layer 57

Data Link Layer

Arp table on each node

Data Link Layer 58

Data Link Layer

How ARP works Case 1 Same LAN

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP table

A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

B receives ARP packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

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

soft state information that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Data Link Layer 59

Data Link Layer

How ARP works Case 2 routing to another LAN

Data Link Layer 60

R

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

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A

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

222222222221

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

B222222222222

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

two ARP tables in router R one for each IP network (LAN)

walkthrough send datagram from A to B via Rassume A knows Brsquos IP address

11

Data Link Layer

A creates IP datagram with source A destination B

A uses ARP to get Rrsquos MAC address for 111111111110

A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagram

Arsquos NIC sends frame

Rrsquos NIC receives frame

R removes IP datagram from Ethernet frame sees its destined to B

R uses ARP to get Brsquos MAC address

R creates frame containing A-to-B IP datagram sends to B

R

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

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A

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

222222222221

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

B222222222222

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

Data Link Layer 61

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-62

Illustration

IP

Eth

Phy

IP src 111111111111

IP dest 222222222222

A creates IP datagram with IP source A destination B

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

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-63

Illustration

IP

Eth

Phy

frame sent from A to R

IP

Eth

Phy

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

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-64

Illustration

IP src 111111111111

IP dest 222222222222

R forwards datagram with IP source A destination B

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

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-65

Illustration R forwards datagram with IP source A destination B

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

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-66

Illustration R forwards datagram with IP source A destination B

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

1

Data Link Layer

Home network

Institutional network

Mobile network

Global ISP

Regional ISP

Data Link Layer (Part B)

Yanmin Zhu

Department of Computer Science and Engineering

COMNETS CSE 1

Data Link Layer

Link Layer

1 Introduction and services

2 Error detection and correction

3 Multiple access protocols

4 Link-layer Addressing

5 Ethernet

6 Link-layer switches

7 Link virtualization ATM

COMNETS CSE 2

Data Link Layer

Ethernet

ldquodominantrdquo wired LAN technology

cheap $20 for NIC

first widely used LAN technology

simpler cheaper than token LANs and ATM

kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet

sketch

COMNETS CSE 3

Data Link Layer

Inventors of Ethernet

Robert Metcalfe PhD Harvard

1973

David Boggs PhD Stanford

1982

Mr Metcalfe generating the ideas

Mr Boggs figuring out how to build the system

COMNETS CSE 4

David Boggs Robert Metcalfe

Data Link Layer

Xerox PARC

Ethernet

Laser Printing

GUI

Object-oriented Programming (SmallTalk)

WYSIWYG

helliphellip

COMNETS CSE 5

Data Link Layer

Metcalfes law

Value of a telecommunications network is proportional to the square of the number of connected users of the system (n2)

COMNETS CSE 6

2

Data Link Layer

Bus Topology

Old fashioned Based on Coax Bus topology popular through mid 90s

bus coaxial cable

COMNETS CSE 7

Data Link Layer

Star topology

today star topology prevailsactive switch in centereach ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

star

COMNETS CSE 8

Data Link Layer

Ethernet Frame Structure

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

Preamble

7 bytes with pattern 10101010 followed by one byte with pattern 10101011

used to synchronize receiver sender clock rates

COMNETS CSE 9

Data Link Layer

Ethernet Frame Structure (more)

Addresses 6 bytes if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

otherwise adapter discards frame

Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

CRC checked at receiver if error is detected frame is dropped

multiplexing COMNETS CSE 10

Data Link Layer

Ethernet Unreliable connectionless

connectionless No handshaking between sending and receiving NICs

unreliable receiving NIC doesnrsquot send acks or nacks to sending NIC stream of datagrams passed to network layer can have gaps

(missing datagrams)

gaps will be filled if app is using TCP

otherwise app will see gaps

Ethernetrsquos MAC protocol unslotted CSMACD

COMNETS CSE 11

Data Link Layer

Ethernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 Carrier sensing If NIC senses channel idle starts frame

transmission

If NIC senses channel busy waits until channel idle then transmits

COMNETS CSE 12

3

Data Link Layer

Ethernet CSMACD algorithm (2)

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

After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2 demo

COMNETS CSE 13

Data Link Layer

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

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

Exponential Backoff Goal adapt retransmission

attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on AWL Web sitehighly recommended

COMNETS CSE 14

httpmediapearsoncmgcomawaw_kurose_networ

k_2appletscsmacdcsmacdhtml

Data Link Layer

Why Exponential

When there are a small number of competitors resolve completion in short time =gt wait a short time

When there are a larger number of competitors resolve completion in longer time

When experiencing more collisions be aware of more competitors

COMNETS CSE 15

Data Link Layer

CSMACD efficiency

Tprop = max prop delay between 2 nodes in LAN

ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0

as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

51

1

COMNETS CSE 16

Data Link Layer

Minimum Frame Length

(1) To make it easier to distinguish valid frames from garbage Ethernet requires that valid frames must be at least 64 bytes long from destination address to checksum

(2) Another is to prevent a station from completing the transmission of a short frame before a potential collision could be detected

COMNETS CSE 17

Data Link Layer

What is the longest delay for A detecting the collision from B after Arsquos transmission of data

Minimum Frame Length (64 bytes)

COMNETS CSE 18

4

Data Link Layer

All frames must take more than 2τ to send so that the transmission is still taking place when the noise burst gets back to the sender in the worst case

Minimum Frame Length (64 bytes)

COMNETS CSE 19

Data Link Layer

Minimum Frame Length (64 bytes)

min

min

2

2 2

F

B

lF B B

v

2 Collision detection can take as long as

COMNETS CSE 20

Data Link Layer

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bps different physical layer media fiber cable

application

transport

network

link

physical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister

pair) physical layer COMNETS CSE 21

Data Link Layer

Manchester encoding

used in 10BaseT

each bit has a transition

allows clocks in sending and receiving nodes to synchronize to each other no need for a centralized global clock among nodes

Hey this is physical-layer stuff

COMNETS CSE 22

Data Link Layer

Development of Ethernet

1973

Invented

Fast Ethernet

IEEE 8023u

1995 1998

Giga Ethernet

IEEE 8023z

2003

10g Ethernet

IEEE 8023ae

1983

IEEE 8023

(thick coax)

COMNETS CSE 23

Data Link Layer

Link Layer

1 Introduction and services

2 Error detection and correction

3 Multiple access protocols

4 Link-layer Addressing

5 Ethernet

6 Link-layer switches

7 Link virtualization ATM

COMNETS CSE 24

Page 3: Data Link Layer “Taking Turns” MAC protocolsyzhu /courses/comnet/slides/Lec23.pdfData Link Layer 49 Data Link Layer “Taking Turns” MAC protocols Token passing: control token

11

Data Link Layer

A creates IP datagram with source A destination B

A uses ARP to get Rrsquos MAC address for 111111111110

A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagram

Arsquos NIC sends frame

Rrsquos NIC receives frame

R removes IP datagram from Ethernet frame sees its destined to B

R uses ARP to get Brsquos MAC address

R creates frame containing A-to-B IP datagram sends to B

R

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

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A

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

222222222221

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

B222222222222

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

Data Link Layer 61

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-62

Illustration

IP

Eth

Phy

IP src 111111111111

IP dest 222222222222

A creates IP datagram with IP source A destination B

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

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-63

Illustration

IP

Eth

Phy

frame sent from A to R

IP

Eth

Phy

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

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-64

Illustration

IP src 111111111111

IP dest 222222222222

R forwards datagram with IP source A destination B

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

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-65

Illustration R forwards datagram with IP source A destination B

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

Data Link Layer

R

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

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

111111111112

111111111111

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

A

222222222222

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

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

B

Link Layer 5-66

Illustration R forwards datagram with IP source A destination B

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

1

Data Link Layer

Home network

Institutional network

Mobile network

Global ISP

Regional ISP

Data Link Layer (Part B)

Yanmin Zhu

Department of Computer Science and Engineering

COMNETS CSE 1

Data Link Layer

Link Layer

1 Introduction and services

2 Error detection and correction

3 Multiple access protocols

4 Link-layer Addressing

5 Ethernet

6 Link-layer switches

7 Link virtualization ATM

COMNETS CSE 2

Data Link Layer

Ethernet

ldquodominantrdquo wired LAN technology

cheap $20 for NIC

first widely used LAN technology

simpler cheaper than token LANs and ATM

kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet

sketch

COMNETS CSE 3

Data Link Layer

Inventors of Ethernet

Robert Metcalfe PhD Harvard

1973

David Boggs PhD Stanford

1982

Mr Metcalfe generating the ideas

Mr Boggs figuring out how to build the system

COMNETS CSE 4

David Boggs Robert Metcalfe

Data Link Layer

Xerox PARC

Ethernet

Laser Printing

GUI

Object-oriented Programming (SmallTalk)

WYSIWYG

helliphellip

COMNETS CSE 5

Data Link Layer

Metcalfes law

Value of a telecommunications network is proportional to the square of the number of connected users of the system (n2)

COMNETS CSE 6

2

Data Link Layer

Bus Topology

Old fashioned Based on Coax Bus topology popular through mid 90s

bus coaxial cable

COMNETS CSE 7

Data Link Layer

Star topology

today star topology prevailsactive switch in centereach ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

star

COMNETS CSE 8

Data Link Layer

Ethernet Frame Structure

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

Preamble

7 bytes with pattern 10101010 followed by one byte with pattern 10101011

used to synchronize receiver sender clock rates

COMNETS CSE 9

Data Link Layer

Ethernet Frame Structure (more)

Addresses 6 bytes if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

otherwise adapter discards frame

Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

CRC checked at receiver if error is detected frame is dropped

multiplexing COMNETS CSE 10

Data Link Layer

Ethernet Unreliable connectionless

connectionless No handshaking between sending and receiving NICs

unreliable receiving NIC doesnrsquot send acks or nacks to sending NIC stream of datagrams passed to network layer can have gaps

(missing datagrams)

gaps will be filled if app is using TCP

otherwise app will see gaps

Ethernetrsquos MAC protocol unslotted CSMACD

COMNETS CSE 11

Data Link Layer

Ethernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 Carrier sensing If NIC senses channel idle starts frame

transmission

If NIC senses channel busy waits until channel idle then transmits

COMNETS CSE 12

3

Data Link Layer

Ethernet CSMACD algorithm (2)

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

After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2 demo

COMNETS CSE 13

Data Link Layer

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

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

Exponential Backoff Goal adapt retransmission

attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on AWL Web sitehighly recommended

COMNETS CSE 14

httpmediapearsoncmgcomawaw_kurose_networ

k_2appletscsmacdcsmacdhtml

Data Link Layer

Why Exponential

When there are a small number of competitors resolve completion in short time =gt wait a short time

When there are a larger number of competitors resolve completion in longer time

When experiencing more collisions be aware of more competitors

COMNETS CSE 15

Data Link Layer

CSMACD efficiency

Tprop = max prop delay between 2 nodes in LAN

ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0

as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

51

1

COMNETS CSE 16

Data Link Layer

Minimum Frame Length

(1) To make it easier to distinguish valid frames from garbage Ethernet requires that valid frames must be at least 64 bytes long from destination address to checksum

(2) Another is to prevent a station from completing the transmission of a short frame before a potential collision could be detected

COMNETS CSE 17

Data Link Layer

What is the longest delay for A detecting the collision from B after Arsquos transmission of data

Minimum Frame Length (64 bytes)

COMNETS CSE 18

4

Data Link Layer

All frames must take more than 2τ to send so that the transmission is still taking place when the noise burst gets back to the sender in the worst case

Minimum Frame Length (64 bytes)

COMNETS CSE 19

Data Link Layer

Minimum Frame Length (64 bytes)

min

min

2

2 2

F

B

lF B B

v

2 Collision detection can take as long as

COMNETS CSE 20

Data Link Layer

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bps different physical layer media fiber cable

application

transport

network

link

physical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister

pair) physical layer COMNETS CSE 21

Data Link Layer

Manchester encoding

used in 10BaseT

each bit has a transition

allows clocks in sending and receiving nodes to synchronize to each other no need for a centralized global clock among nodes

Hey this is physical-layer stuff

COMNETS CSE 22

Data Link Layer

Development of Ethernet

1973

Invented

Fast Ethernet

IEEE 8023u

1995 1998

Giga Ethernet

IEEE 8023z

2003

10g Ethernet

IEEE 8023ae

1983

IEEE 8023

(thick coax)

COMNETS CSE 23

Data Link Layer

Link Layer

1 Introduction and services

2 Error detection and correction

3 Multiple access protocols

4 Link-layer Addressing

5 Ethernet

6 Link-layer switches

7 Link virtualization ATM

COMNETS CSE 24

Page 4: Data Link Layer “Taking Turns” MAC protocolsyzhu /courses/comnet/slides/Lec23.pdfData Link Layer 49 Data Link Layer “Taking Turns” MAC protocols Token passing: control token

1

Data Link Layer

Home network

Institutional network

Mobile network

Global ISP

Regional ISP

Data Link Layer (Part B)

Yanmin Zhu

Department of Computer Science and Engineering

COMNETS CSE 1

Data Link Layer

Link Layer

1 Introduction and services

2 Error detection and correction

3 Multiple access protocols

4 Link-layer Addressing

5 Ethernet

6 Link-layer switches

7 Link virtualization ATM

COMNETS CSE 2

Data Link Layer

Ethernet

ldquodominantrdquo wired LAN technology

cheap $20 for NIC

first widely used LAN technology

simpler cheaper than token LANs and ATM

kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet

sketch

COMNETS CSE 3

Data Link Layer

Inventors of Ethernet

Robert Metcalfe PhD Harvard

1973

David Boggs PhD Stanford

1982

Mr Metcalfe generating the ideas

Mr Boggs figuring out how to build the system

COMNETS CSE 4

David Boggs Robert Metcalfe

Data Link Layer

Xerox PARC

Ethernet

Laser Printing

GUI

Object-oriented Programming (SmallTalk)

WYSIWYG

helliphellip

COMNETS CSE 5

Data Link Layer

Metcalfes law

Value of a telecommunications network is proportional to the square of the number of connected users of the system (n2)

COMNETS CSE 6

2

Data Link Layer

Bus Topology

Old fashioned Based on Coax Bus topology popular through mid 90s

bus coaxial cable

COMNETS CSE 7

Data Link Layer

Star topology

today star topology prevailsactive switch in centereach ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

star

COMNETS CSE 8

Data Link Layer

Ethernet Frame Structure

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

Preamble

7 bytes with pattern 10101010 followed by one byte with pattern 10101011

used to synchronize receiver sender clock rates

COMNETS CSE 9

Data Link Layer

Ethernet Frame Structure (more)

Addresses 6 bytes if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

otherwise adapter discards frame

Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

CRC checked at receiver if error is detected frame is dropped

multiplexing COMNETS CSE 10

Data Link Layer

Ethernet Unreliable connectionless

connectionless No handshaking between sending and receiving NICs

unreliable receiving NIC doesnrsquot send acks or nacks to sending NIC stream of datagrams passed to network layer can have gaps

(missing datagrams)

gaps will be filled if app is using TCP

otherwise app will see gaps

Ethernetrsquos MAC protocol unslotted CSMACD

COMNETS CSE 11

Data Link Layer

Ethernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 Carrier sensing If NIC senses channel idle starts frame

transmission

If NIC senses channel busy waits until channel idle then transmits

COMNETS CSE 12

3

Data Link Layer

Ethernet CSMACD algorithm (2)

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

After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2 demo

COMNETS CSE 13

Data Link Layer

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

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

Exponential Backoff Goal adapt retransmission

attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on AWL Web sitehighly recommended

COMNETS CSE 14

httpmediapearsoncmgcomawaw_kurose_networ

k_2appletscsmacdcsmacdhtml

Data Link Layer

Why Exponential

When there are a small number of competitors resolve completion in short time =gt wait a short time

When there are a larger number of competitors resolve completion in longer time

When experiencing more collisions be aware of more competitors

COMNETS CSE 15

Data Link Layer

CSMACD efficiency

Tprop = max prop delay between 2 nodes in LAN

ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0

as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

51

1

COMNETS CSE 16

Data Link Layer

Minimum Frame Length

(1) To make it easier to distinguish valid frames from garbage Ethernet requires that valid frames must be at least 64 bytes long from destination address to checksum

(2) Another is to prevent a station from completing the transmission of a short frame before a potential collision could be detected

COMNETS CSE 17

Data Link Layer

What is the longest delay for A detecting the collision from B after Arsquos transmission of data

Minimum Frame Length (64 bytes)

COMNETS CSE 18

4

Data Link Layer

All frames must take more than 2τ to send so that the transmission is still taking place when the noise burst gets back to the sender in the worst case

Minimum Frame Length (64 bytes)

COMNETS CSE 19

Data Link Layer

Minimum Frame Length (64 bytes)

min

min

2

2 2

F

B

lF B B

v

2 Collision detection can take as long as

COMNETS CSE 20

Data Link Layer

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bps different physical layer media fiber cable

application

transport

network

link

physical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister

pair) physical layer COMNETS CSE 21

Data Link Layer

Manchester encoding

used in 10BaseT

each bit has a transition

allows clocks in sending and receiving nodes to synchronize to each other no need for a centralized global clock among nodes

Hey this is physical-layer stuff

COMNETS CSE 22

Data Link Layer

Development of Ethernet

1973

Invented

Fast Ethernet

IEEE 8023u

1995 1998

Giga Ethernet

IEEE 8023z

2003

10g Ethernet

IEEE 8023ae

1983

IEEE 8023

(thick coax)

COMNETS CSE 23

Data Link Layer

Link Layer

1 Introduction and services

2 Error detection and correction

3 Multiple access protocols

4 Link-layer Addressing

5 Ethernet

6 Link-layer switches

7 Link virtualization ATM

COMNETS CSE 24

Page 5: Data Link Layer “Taking Turns” MAC protocolsyzhu /courses/comnet/slides/Lec23.pdfData Link Layer 49 Data Link Layer “Taking Turns” MAC protocols Token passing: control token

2

Data Link Layer

Bus Topology

Old fashioned Based on Coax Bus topology popular through mid 90s

bus coaxial cable

COMNETS CSE 7

Data Link Layer

Star topology

today star topology prevailsactive switch in centereach ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

star

COMNETS CSE 8

Data Link Layer

Ethernet Frame Structure

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

Preamble

7 bytes with pattern 10101010 followed by one byte with pattern 10101011

used to synchronize receiver sender clock rates

COMNETS CSE 9

Data Link Layer

Ethernet Frame Structure (more)

Addresses 6 bytes if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

otherwise adapter discards frame

Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

CRC checked at receiver if error is detected frame is dropped

multiplexing COMNETS CSE 10

Data Link Layer

Ethernet Unreliable connectionless

connectionless No handshaking between sending and receiving NICs

unreliable receiving NIC doesnrsquot send acks or nacks to sending NIC stream of datagrams passed to network layer can have gaps

(missing datagrams)

gaps will be filled if app is using TCP

otherwise app will see gaps

Ethernetrsquos MAC protocol unslotted CSMACD

COMNETS CSE 11

Data Link Layer

Ethernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 Carrier sensing If NIC senses channel idle starts frame

transmission

If NIC senses channel busy waits until channel idle then transmits

COMNETS CSE 12

3

Data Link Layer

Ethernet CSMACD algorithm (2)

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

After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2 demo

COMNETS CSE 13

Data Link Layer

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

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

Exponential Backoff Goal adapt retransmission

attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on AWL Web sitehighly recommended

COMNETS CSE 14

httpmediapearsoncmgcomawaw_kurose_networ

k_2appletscsmacdcsmacdhtml

Data Link Layer

Why Exponential

When there are a small number of competitors resolve completion in short time =gt wait a short time

When there are a larger number of competitors resolve completion in longer time

When experiencing more collisions be aware of more competitors

COMNETS CSE 15

Data Link Layer

CSMACD efficiency

Tprop = max prop delay between 2 nodes in LAN

ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0

as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

51

1

COMNETS CSE 16

Data Link Layer

Minimum Frame Length

(1) To make it easier to distinguish valid frames from garbage Ethernet requires that valid frames must be at least 64 bytes long from destination address to checksum

(2) Another is to prevent a station from completing the transmission of a short frame before a potential collision could be detected

COMNETS CSE 17

Data Link Layer

What is the longest delay for A detecting the collision from B after Arsquos transmission of data

Minimum Frame Length (64 bytes)

COMNETS CSE 18

4

Data Link Layer

All frames must take more than 2τ to send so that the transmission is still taking place when the noise burst gets back to the sender in the worst case

Minimum Frame Length (64 bytes)

COMNETS CSE 19

Data Link Layer

Minimum Frame Length (64 bytes)

min

min

2

2 2

F

B

lF B B

v

2 Collision detection can take as long as

COMNETS CSE 20

Data Link Layer

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bps different physical layer media fiber cable

application

transport

network

link

physical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister

pair) physical layer COMNETS CSE 21

Data Link Layer

Manchester encoding

used in 10BaseT

each bit has a transition

allows clocks in sending and receiving nodes to synchronize to each other no need for a centralized global clock among nodes

Hey this is physical-layer stuff

COMNETS CSE 22

Data Link Layer

Development of Ethernet

1973

Invented

Fast Ethernet

IEEE 8023u

1995 1998

Giga Ethernet

IEEE 8023z

2003

10g Ethernet

IEEE 8023ae

1983

IEEE 8023

(thick coax)

COMNETS CSE 23

Data Link Layer

Link Layer

1 Introduction and services

2 Error detection and correction

3 Multiple access protocols

4 Link-layer Addressing

5 Ethernet

6 Link-layer switches

7 Link virtualization ATM

COMNETS CSE 24

Page 6: Data Link Layer “Taking Turns” MAC protocolsyzhu /courses/comnet/slides/Lec23.pdfData Link Layer 49 Data Link Layer “Taking Turns” MAC protocols Token passing: control token

3

Data Link Layer

Ethernet CSMACD algorithm (2)

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

After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2 demo

COMNETS CSE 13

Data Link Layer

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

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

Exponential Backoff Goal adapt retransmission

attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on AWL Web sitehighly recommended

COMNETS CSE 14

httpmediapearsoncmgcomawaw_kurose_networ

k_2appletscsmacdcsmacdhtml

Data Link Layer

Why Exponential

When there are a small number of competitors resolve completion in short time =gt wait a short time

When there are a larger number of competitors resolve completion in longer time

When experiencing more collisions be aware of more competitors

COMNETS CSE 15

Data Link Layer

CSMACD efficiency

Tprop = max prop delay between 2 nodes in LAN

ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0

as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

51

1

COMNETS CSE 16

Data Link Layer

Minimum Frame Length

(1) To make it easier to distinguish valid frames from garbage Ethernet requires that valid frames must be at least 64 bytes long from destination address to checksum

(2) Another is to prevent a station from completing the transmission of a short frame before a potential collision could be detected

COMNETS CSE 17

Data Link Layer

What is the longest delay for A detecting the collision from B after Arsquos transmission of data

Minimum Frame Length (64 bytes)

COMNETS CSE 18

4

Data Link Layer

All frames must take more than 2τ to send so that the transmission is still taking place when the noise burst gets back to the sender in the worst case

Minimum Frame Length (64 bytes)

COMNETS CSE 19

Data Link Layer

Minimum Frame Length (64 bytes)

min

min

2

2 2

F

B

lF B B

v

2 Collision detection can take as long as

COMNETS CSE 20

Data Link Layer

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bps different physical layer media fiber cable

application

transport

network

link

physical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister

pair) physical layer COMNETS CSE 21

Data Link Layer

Manchester encoding

used in 10BaseT

each bit has a transition

allows clocks in sending and receiving nodes to synchronize to each other no need for a centralized global clock among nodes

Hey this is physical-layer stuff

COMNETS CSE 22

Data Link Layer

Development of Ethernet

1973

Invented

Fast Ethernet

IEEE 8023u

1995 1998

Giga Ethernet

IEEE 8023z

2003

10g Ethernet

IEEE 8023ae

1983

IEEE 8023

(thick coax)

COMNETS CSE 23

Data Link Layer

Link Layer

1 Introduction and services

2 Error detection and correction

3 Multiple access protocols

4 Link-layer Addressing

5 Ethernet

6 Link-layer switches

7 Link virtualization ATM

COMNETS CSE 24

Page 7: Data Link Layer “Taking Turns” MAC protocolsyzhu /courses/comnet/slides/Lec23.pdfData Link Layer 49 Data Link Layer “Taking Turns” MAC protocols Token passing: control token

4

Data Link Layer

All frames must take more than 2τ to send so that the transmission is still taking place when the noise burst gets back to the sender in the worst case

Minimum Frame Length (64 bytes)

COMNETS CSE 19

Data Link Layer

Minimum Frame Length (64 bytes)

min

min

2

2 2

F

B

lF B B

v

2 Collision detection can take as long as

COMNETS CSE 20

Data Link Layer

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bps different physical layer media fiber cable

application

transport

network

link

physical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister

pair) physical layer COMNETS CSE 21

Data Link Layer

Manchester encoding

used in 10BaseT

each bit has a transition

allows clocks in sending and receiving nodes to synchronize to each other no need for a centralized global clock among nodes

Hey this is physical-layer stuff

COMNETS CSE 22

Data Link Layer

Development of Ethernet

1973

Invented

Fast Ethernet

IEEE 8023u

1995 1998

Giga Ethernet

IEEE 8023z

2003

10g Ethernet

IEEE 8023ae

1983

IEEE 8023

(thick coax)

COMNETS CSE 23

Data Link Layer

Link Layer

1 Introduction and services

2 Error detection and correction

3 Multiple access protocols

4 Link-layer Addressing

5 Ethernet

6 Link-layer switches

7 Link virtualization ATM

COMNETS CSE 24