lecture 13

53
Introduction 1-1 Lecture 13 Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 CS3516: These slides are generated from those made available by the authors of our text.

Upload: deron

Post on 13-Feb-2016

28 views

Category:

Documents


0 download

DESCRIPTION

Lecture 13. Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012. CS3516: These slides are generated from those made available by the authors of our text. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lecture 13

Introduction 1-1

Lecture 13

Computer Networking A Top Down Approach 6th edition Jim Kurose Keith RossAddison-WesleyMarch 2012

CS3516

These slides are generated from those made available by the authors of our text

Network Layer 4-2

Get MAC Address (Getmacexe) Discovers the Media Access Control (MAC) address and lists associated network protocols for all network cards in a computer either locally or across a network

CUsersjbgtgetmacPhysical Address Transport Name============ =============================60-36-DD-AA-13-69 Media disconnected60-36-DD-AA-13-65 DeviceTcpip_437F350E-DFD7-4A86-B063-0B9650BD440460-36-DD-AA-13-66 Media disconnected60-36-DD-AA-13-66 Media disconnectedB8-CA-3A-DC-C6-2B Media disconnected08-00-27-00-E4-38 DeviceTcpip_F551D578-DC71-4760-B91C-B349EAE4238F

Useful Commands

Network Layer 4-3

IP Configuration Utility (Ipconfigexe) Displays all current (TCPIP) network configurations

CUsersjbgtipconfig

Windows IP ConfigurationEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Link-local IPv6 Address fe80e59174d4a495799816 IPv4 Address 1302152836 Subnet Mask 2552552480 Default Gateway 130215241

CUsersjbgtipconfig Prints command line options

CUsersjbgtipconfig displaydns gives dns info cached on nodecswpiedu ---------------------------------------- Record Name cswpiedu Record Type 1 Time To Live 73497 Data Length 4 Section Answer A (Host) Record 13021528181

Useful Commands

Network Layer 4-4

Name Server Lookup (Nslookupexe) Displays information about Domain Name System records for specific IP addresses andor host names so that you can troubleshoot DNS problems

CUsersjbgtnslookup wwwgooglecomServer aresolverslevel3net this is the name of the default serverAddress 4221

Non-authoritative answerName wwwgooglecomAddresses 2607f8b040008041011 74125227179 74125227180 74125227176 74125227177 74125227178

Useful Commands

Network Layer 4-5

Net services commands (Netexe) Performs a broad range of network tasks Type net with no parameters to see a full list of available command-line options

CUsersjbgtnet helpThe syntax of this command is

Commands available are

NET ACCOUNTS NET HELPMSG NET STATISTICS NET COMPUTER NET LOCALGROUP NET STOP NET CONFIG NET PAUSE NET TIME NET CONTINUE NET SESSION NET USE NET FILE NET SHARE NET USER NET GROUP NET START NET VIEW NET HELP

NET HELP NAMES explains different types of names in NET HELP syntax lines

NET HELP SERVICES lists some of the services you can start NET HELP SYNTAX explains how to read NET HELP syntax lines NET HELP command | MORE displays Help one screen at a time

Useful Commands

Network Layer 4-6

Netstat (Netstatexe) Displays active TCP connections ports on which the computer is listening Ethernet statistics the IP routing table and IPv4IPv6 statistics

CUsersjbgtnetstat

Proto Local Address Foreign Address State TCP 1270011029 jb-laptop5354 ESTABLISHED TCP 1270011036 jb-laptop27015 ESTABLISHED TCP 1270011047 jb-laptop19872 ESTABLISHED TCP 12700139055 jb-laptop39054 ESTABLISHED TCP 172171681382492 blugro5relay2492 ESTABLISHED

CUsersjbgtnetstat -sIPv4 Statistics Packets Received = 10158258 Received Header Errors = 2848 Received Address Errors = 2192434 Datagrams Forwarded = 0 Unknown Protocols Received = 170614 Received Packets Discarded = 4173788 Received Packets Delivered = 6692404

Useful Commands

Network Layer 4-7

Network Command Shell (Netshexe) Displays or modifies the network configuration of a local or remote computer that is currently running This command-line scripting utility has a huge number of options which are fully detailed in Help

TCPIP Route (Routeexe) Displays and modifies entries in the local IP routing table

CUsersjbgtroute printInterface List1360 36 dd aa 13 65 Intel(R) Centrino(R) Wireless-N 22301260 36 dd aa 13 69 Bluetooth Device (Personal Area Network)3108 00 27 00 e4 38 VirtualBox Host-Only Ethernet Adapter

IPv4 Route TableNetwork Destination Netmask Gateway Interface Metric 0000 0000 1721711 17217168138 25 127000 255000 On-link 127001 306 127001 255255255255 On-link 127001 306 127255255255 255255255255 On-link 127001 306 16925400 25525500 On-link 16925440182 276 16925440182 255255255255 On-link 16925440182 276 169254255255 255255255255 On-link 16925440182 276 1721700 25525500 On-link 17217168138 281 17217168138 255255255255 On-link 17217168138 281 17217255255 255255255255 On-link 17217168138 281 224000 240000 On-link 16925440182 276

Useful Commands

Network Layer 4-8

(Arpexe) Displays current ARP entries by interrogating the current protocol data If inet_addr is specified the IP and Physical addresses for only the specified computer are displayed If more than one network interface uses ARP entries for each ARP table are displayed

CUsersjbgtarp -a

Interface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527252 f0-1f-af-2f-e1-27 dynamic 1302152863 00-16-3e-c5-01-25 dynamic 13021529165 00-24-e8-32-32-1d dynamic 13021531255 ff-ff-ff-ff-ff-ff static

Useful Commands

Link Layer 5-9

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-10

Link layer introductionterminology hosts and routers

nodes communication

channels that connect adjacent nodes along communication path links wired links wireless links LANs

layer-2 packet frame encapsulates datagramdata-link layer has responsibility of

transferring datagram from one node to physically adjacent node over a link

global ISP

Link Layer 5-11

Link layer context datagram transferred

by different link protocols over different links eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg may or may not

provide rdt over link

framing link access encapsulate datagram

into frame adding header trailer

channel access if shared medium

ldquoMACrdquo addresses used in frame headers to identify source dest bull different from IP

address

reliable delivery between adjacent nodeswe learned how to do this already ndash Transport layerseldom used on low bit-error link (fiber some twisted pair)wireless links high error rates

Q why both link-level and end-end reliability

Link Layer 5-12

flow control pacing between adjacent sending and receiving

nodes error detection

errors caused by signal attenuation noise receiver detects presence of errors

bull signals sender for retransmission or drops frame error correction

receiver identifies and corrects bit error(s) without resorting to retransmission

half-duplex and full-duplex with half duplex nodes at both ends of link can

transmit but not at same time

Link layer services (more)

Link Layer 5-13

Where is the link layer implemented in each and every host link layer implemented

in ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card

80211 card Ethernet chipset

implements link physical layer

attaches into hostrsquos system buses

combination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

Link Layer 5-14

Link layer LANs outline51 introduction services52 error detection correction SKIPPED53 multiple access protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

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

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

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

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

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

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

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

transmit immediately collision probability increases

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

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

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

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

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

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

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

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

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

longer backoff interval with more collisions

Link Layer 5-28

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

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

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

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

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

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

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

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

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

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

address (unicast)

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

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

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

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

111111111112

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

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

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

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

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

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

111111111112

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

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

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

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

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

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

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

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

111111111112

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

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

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

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

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

111111111112

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

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

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

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

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

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

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

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

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

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 2: Lecture 13

Network Layer 4-2

Get MAC Address (Getmacexe) Discovers the Media Access Control (MAC) address and lists associated network protocols for all network cards in a computer either locally or across a network

CUsersjbgtgetmacPhysical Address Transport Name============ =============================60-36-DD-AA-13-69 Media disconnected60-36-DD-AA-13-65 DeviceTcpip_437F350E-DFD7-4A86-B063-0B9650BD440460-36-DD-AA-13-66 Media disconnected60-36-DD-AA-13-66 Media disconnectedB8-CA-3A-DC-C6-2B Media disconnected08-00-27-00-E4-38 DeviceTcpip_F551D578-DC71-4760-B91C-B349EAE4238F

Useful Commands

Network Layer 4-3

IP Configuration Utility (Ipconfigexe) Displays all current (TCPIP) network configurations

CUsersjbgtipconfig

Windows IP ConfigurationEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Link-local IPv6 Address fe80e59174d4a495799816 IPv4 Address 1302152836 Subnet Mask 2552552480 Default Gateway 130215241

CUsersjbgtipconfig Prints command line options

CUsersjbgtipconfig displaydns gives dns info cached on nodecswpiedu ---------------------------------------- Record Name cswpiedu Record Type 1 Time To Live 73497 Data Length 4 Section Answer A (Host) Record 13021528181

Useful Commands

Network Layer 4-4

Name Server Lookup (Nslookupexe) Displays information about Domain Name System records for specific IP addresses andor host names so that you can troubleshoot DNS problems

CUsersjbgtnslookup wwwgooglecomServer aresolverslevel3net this is the name of the default serverAddress 4221

Non-authoritative answerName wwwgooglecomAddresses 2607f8b040008041011 74125227179 74125227180 74125227176 74125227177 74125227178

Useful Commands

Network Layer 4-5

Net services commands (Netexe) Performs a broad range of network tasks Type net with no parameters to see a full list of available command-line options

CUsersjbgtnet helpThe syntax of this command is

Commands available are

NET ACCOUNTS NET HELPMSG NET STATISTICS NET COMPUTER NET LOCALGROUP NET STOP NET CONFIG NET PAUSE NET TIME NET CONTINUE NET SESSION NET USE NET FILE NET SHARE NET USER NET GROUP NET START NET VIEW NET HELP

NET HELP NAMES explains different types of names in NET HELP syntax lines

NET HELP SERVICES lists some of the services you can start NET HELP SYNTAX explains how to read NET HELP syntax lines NET HELP command | MORE displays Help one screen at a time

Useful Commands

Network Layer 4-6

Netstat (Netstatexe) Displays active TCP connections ports on which the computer is listening Ethernet statistics the IP routing table and IPv4IPv6 statistics

CUsersjbgtnetstat

Proto Local Address Foreign Address State TCP 1270011029 jb-laptop5354 ESTABLISHED TCP 1270011036 jb-laptop27015 ESTABLISHED TCP 1270011047 jb-laptop19872 ESTABLISHED TCP 12700139055 jb-laptop39054 ESTABLISHED TCP 172171681382492 blugro5relay2492 ESTABLISHED

CUsersjbgtnetstat -sIPv4 Statistics Packets Received = 10158258 Received Header Errors = 2848 Received Address Errors = 2192434 Datagrams Forwarded = 0 Unknown Protocols Received = 170614 Received Packets Discarded = 4173788 Received Packets Delivered = 6692404

Useful Commands

Network Layer 4-7

Network Command Shell (Netshexe) Displays or modifies the network configuration of a local or remote computer that is currently running This command-line scripting utility has a huge number of options which are fully detailed in Help

TCPIP Route (Routeexe) Displays and modifies entries in the local IP routing table

CUsersjbgtroute printInterface List1360 36 dd aa 13 65 Intel(R) Centrino(R) Wireless-N 22301260 36 dd aa 13 69 Bluetooth Device (Personal Area Network)3108 00 27 00 e4 38 VirtualBox Host-Only Ethernet Adapter

IPv4 Route TableNetwork Destination Netmask Gateway Interface Metric 0000 0000 1721711 17217168138 25 127000 255000 On-link 127001 306 127001 255255255255 On-link 127001 306 127255255255 255255255255 On-link 127001 306 16925400 25525500 On-link 16925440182 276 16925440182 255255255255 On-link 16925440182 276 169254255255 255255255255 On-link 16925440182 276 1721700 25525500 On-link 17217168138 281 17217168138 255255255255 On-link 17217168138 281 17217255255 255255255255 On-link 17217168138 281 224000 240000 On-link 16925440182 276

Useful Commands

Network Layer 4-8

(Arpexe) Displays current ARP entries by interrogating the current protocol data If inet_addr is specified the IP and Physical addresses for only the specified computer are displayed If more than one network interface uses ARP entries for each ARP table are displayed

CUsersjbgtarp -a

Interface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527252 f0-1f-af-2f-e1-27 dynamic 1302152863 00-16-3e-c5-01-25 dynamic 13021529165 00-24-e8-32-32-1d dynamic 13021531255 ff-ff-ff-ff-ff-ff static

Useful Commands

Link Layer 5-9

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-10

Link layer introductionterminology hosts and routers

nodes communication

channels that connect adjacent nodes along communication path links wired links wireless links LANs

layer-2 packet frame encapsulates datagramdata-link layer has responsibility of

transferring datagram from one node to physically adjacent node over a link

global ISP

Link Layer 5-11

Link layer context datagram transferred

by different link protocols over different links eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg may or may not

provide rdt over link

framing link access encapsulate datagram

into frame adding header trailer

channel access if shared medium

ldquoMACrdquo addresses used in frame headers to identify source dest bull different from IP

address

reliable delivery between adjacent nodeswe learned how to do this already ndash Transport layerseldom used on low bit-error link (fiber some twisted pair)wireless links high error rates

Q why both link-level and end-end reliability

Link Layer 5-12

flow control pacing between adjacent sending and receiving

nodes error detection

errors caused by signal attenuation noise receiver detects presence of errors

bull signals sender for retransmission or drops frame error correction

receiver identifies and corrects bit error(s) without resorting to retransmission

half-duplex and full-duplex with half duplex nodes at both ends of link can

transmit but not at same time

Link layer services (more)

Link Layer 5-13

Where is the link layer implemented in each and every host link layer implemented

in ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card

80211 card Ethernet chipset

implements link physical layer

attaches into hostrsquos system buses

combination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

Link Layer 5-14

Link layer LANs outline51 introduction services52 error detection correction SKIPPED53 multiple access protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

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

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

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

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

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

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

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

transmit immediately collision probability increases

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

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

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

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

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

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

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

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

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

longer backoff interval with more collisions

Link Layer 5-28

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

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

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

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

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

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

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

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

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

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

address (unicast)

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

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

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

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

111111111112

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

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

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

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

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

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

111111111112

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

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

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

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

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

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

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

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

111111111112

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

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

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

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

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

111111111112

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

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

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

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

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

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

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

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

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

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 3: Lecture 13

Network Layer 4-3

IP Configuration Utility (Ipconfigexe) Displays all current (TCPIP) network configurations

CUsersjbgtipconfig

Windows IP ConfigurationEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Link-local IPv6 Address fe80e59174d4a495799816 IPv4 Address 1302152836 Subnet Mask 2552552480 Default Gateway 130215241

CUsersjbgtipconfig Prints command line options

CUsersjbgtipconfig displaydns gives dns info cached on nodecswpiedu ---------------------------------------- Record Name cswpiedu Record Type 1 Time To Live 73497 Data Length 4 Section Answer A (Host) Record 13021528181

Useful Commands

Network Layer 4-4

Name Server Lookup (Nslookupexe) Displays information about Domain Name System records for specific IP addresses andor host names so that you can troubleshoot DNS problems

CUsersjbgtnslookup wwwgooglecomServer aresolverslevel3net this is the name of the default serverAddress 4221

Non-authoritative answerName wwwgooglecomAddresses 2607f8b040008041011 74125227179 74125227180 74125227176 74125227177 74125227178

Useful Commands

Network Layer 4-5

Net services commands (Netexe) Performs a broad range of network tasks Type net with no parameters to see a full list of available command-line options

CUsersjbgtnet helpThe syntax of this command is

Commands available are

NET ACCOUNTS NET HELPMSG NET STATISTICS NET COMPUTER NET LOCALGROUP NET STOP NET CONFIG NET PAUSE NET TIME NET CONTINUE NET SESSION NET USE NET FILE NET SHARE NET USER NET GROUP NET START NET VIEW NET HELP

NET HELP NAMES explains different types of names in NET HELP syntax lines

NET HELP SERVICES lists some of the services you can start NET HELP SYNTAX explains how to read NET HELP syntax lines NET HELP command | MORE displays Help one screen at a time

Useful Commands

Network Layer 4-6

Netstat (Netstatexe) Displays active TCP connections ports on which the computer is listening Ethernet statistics the IP routing table and IPv4IPv6 statistics

CUsersjbgtnetstat

Proto Local Address Foreign Address State TCP 1270011029 jb-laptop5354 ESTABLISHED TCP 1270011036 jb-laptop27015 ESTABLISHED TCP 1270011047 jb-laptop19872 ESTABLISHED TCP 12700139055 jb-laptop39054 ESTABLISHED TCP 172171681382492 blugro5relay2492 ESTABLISHED

CUsersjbgtnetstat -sIPv4 Statistics Packets Received = 10158258 Received Header Errors = 2848 Received Address Errors = 2192434 Datagrams Forwarded = 0 Unknown Protocols Received = 170614 Received Packets Discarded = 4173788 Received Packets Delivered = 6692404

Useful Commands

Network Layer 4-7

Network Command Shell (Netshexe) Displays or modifies the network configuration of a local or remote computer that is currently running This command-line scripting utility has a huge number of options which are fully detailed in Help

TCPIP Route (Routeexe) Displays and modifies entries in the local IP routing table

CUsersjbgtroute printInterface List1360 36 dd aa 13 65 Intel(R) Centrino(R) Wireless-N 22301260 36 dd aa 13 69 Bluetooth Device (Personal Area Network)3108 00 27 00 e4 38 VirtualBox Host-Only Ethernet Adapter

IPv4 Route TableNetwork Destination Netmask Gateway Interface Metric 0000 0000 1721711 17217168138 25 127000 255000 On-link 127001 306 127001 255255255255 On-link 127001 306 127255255255 255255255255 On-link 127001 306 16925400 25525500 On-link 16925440182 276 16925440182 255255255255 On-link 16925440182 276 169254255255 255255255255 On-link 16925440182 276 1721700 25525500 On-link 17217168138 281 17217168138 255255255255 On-link 17217168138 281 17217255255 255255255255 On-link 17217168138 281 224000 240000 On-link 16925440182 276

Useful Commands

Network Layer 4-8

(Arpexe) Displays current ARP entries by interrogating the current protocol data If inet_addr is specified the IP and Physical addresses for only the specified computer are displayed If more than one network interface uses ARP entries for each ARP table are displayed

CUsersjbgtarp -a

Interface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527252 f0-1f-af-2f-e1-27 dynamic 1302152863 00-16-3e-c5-01-25 dynamic 13021529165 00-24-e8-32-32-1d dynamic 13021531255 ff-ff-ff-ff-ff-ff static

Useful Commands

Link Layer 5-9

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-10

Link layer introductionterminology hosts and routers

nodes communication

channels that connect adjacent nodes along communication path links wired links wireless links LANs

layer-2 packet frame encapsulates datagramdata-link layer has responsibility of

transferring datagram from one node to physically adjacent node over a link

global ISP

Link Layer 5-11

Link layer context datagram transferred

by different link protocols over different links eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg may or may not

provide rdt over link

framing link access encapsulate datagram

into frame adding header trailer

channel access if shared medium

ldquoMACrdquo addresses used in frame headers to identify source dest bull different from IP

address

reliable delivery between adjacent nodeswe learned how to do this already ndash Transport layerseldom used on low bit-error link (fiber some twisted pair)wireless links high error rates

Q why both link-level and end-end reliability

Link Layer 5-12

flow control pacing between adjacent sending and receiving

nodes error detection

errors caused by signal attenuation noise receiver detects presence of errors

bull signals sender for retransmission or drops frame error correction

receiver identifies and corrects bit error(s) without resorting to retransmission

half-duplex and full-duplex with half duplex nodes at both ends of link can

transmit but not at same time

Link layer services (more)

Link Layer 5-13

Where is the link layer implemented in each and every host link layer implemented

in ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card

80211 card Ethernet chipset

implements link physical layer

attaches into hostrsquos system buses

combination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

Link Layer 5-14

Link layer LANs outline51 introduction services52 error detection correction SKIPPED53 multiple access protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

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

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

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

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

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

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

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

transmit immediately collision probability increases

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

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

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

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

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

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

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

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

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

longer backoff interval with more collisions

Link Layer 5-28

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

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

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

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

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

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

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

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

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

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

address (unicast)

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

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

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

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

111111111112

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

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

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

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

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

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

111111111112

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

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

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

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

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

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

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

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

111111111112

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

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

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

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

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

111111111112

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

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

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

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

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

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

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

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

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

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 4: Lecture 13

Network Layer 4-4

Name Server Lookup (Nslookupexe) Displays information about Domain Name System records for specific IP addresses andor host names so that you can troubleshoot DNS problems

CUsersjbgtnslookup wwwgooglecomServer aresolverslevel3net this is the name of the default serverAddress 4221

Non-authoritative answerName wwwgooglecomAddresses 2607f8b040008041011 74125227179 74125227180 74125227176 74125227177 74125227178

Useful Commands

Network Layer 4-5

Net services commands (Netexe) Performs a broad range of network tasks Type net with no parameters to see a full list of available command-line options

CUsersjbgtnet helpThe syntax of this command is

Commands available are

NET ACCOUNTS NET HELPMSG NET STATISTICS NET COMPUTER NET LOCALGROUP NET STOP NET CONFIG NET PAUSE NET TIME NET CONTINUE NET SESSION NET USE NET FILE NET SHARE NET USER NET GROUP NET START NET VIEW NET HELP

NET HELP NAMES explains different types of names in NET HELP syntax lines

NET HELP SERVICES lists some of the services you can start NET HELP SYNTAX explains how to read NET HELP syntax lines NET HELP command | MORE displays Help one screen at a time

Useful Commands

Network Layer 4-6

Netstat (Netstatexe) Displays active TCP connections ports on which the computer is listening Ethernet statistics the IP routing table and IPv4IPv6 statistics

CUsersjbgtnetstat

Proto Local Address Foreign Address State TCP 1270011029 jb-laptop5354 ESTABLISHED TCP 1270011036 jb-laptop27015 ESTABLISHED TCP 1270011047 jb-laptop19872 ESTABLISHED TCP 12700139055 jb-laptop39054 ESTABLISHED TCP 172171681382492 blugro5relay2492 ESTABLISHED

CUsersjbgtnetstat -sIPv4 Statistics Packets Received = 10158258 Received Header Errors = 2848 Received Address Errors = 2192434 Datagrams Forwarded = 0 Unknown Protocols Received = 170614 Received Packets Discarded = 4173788 Received Packets Delivered = 6692404

Useful Commands

Network Layer 4-7

Network Command Shell (Netshexe) Displays or modifies the network configuration of a local or remote computer that is currently running This command-line scripting utility has a huge number of options which are fully detailed in Help

TCPIP Route (Routeexe) Displays and modifies entries in the local IP routing table

CUsersjbgtroute printInterface List1360 36 dd aa 13 65 Intel(R) Centrino(R) Wireless-N 22301260 36 dd aa 13 69 Bluetooth Device (Personal Area Network)3108 00 27 00 e4 38 VirtualBox Host-Only Ethernet Adapter

IPv4 Route TableNetwork Destination Netmask Gateway Interface Metric 0000 0000 1721711 17217168138 25 127000 255000 On-link 127001 306 127001 255255255255 On-link 127001 306 127255255255 255255255255 On-link 127001 306 16925400 25525500 On-link 16925440182 276 16925440182 255255255255 On-link 16925440182 276 169254255255 255255255255 On-link 16925440182 276 1721700 25525500 On-link 17217168138 281 17217168138 255255255255 On-link 17217168138 281 17217255255 255255255255 On-link 17217168138 281 224000 240000 On-link 16925440182 276

Useful Commands

Network Layer 4-8

(Arpexe) Displays current ARP entries by interrogating the current protocol data If inet_addr is specified the IP and Physical addresses for only the specified computer are displayed If more than one network interface uses ARP entries for each ARP table are displayed

CUsersjbgtarp -a

Interface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527252 f0-1f-af-2f-e1-27 dynamic 1302152863 00-16-3e-c5-01-25 dynamic 13021529165 00-24-e8-32-32-1d dynamic 13021531255 ff-ff-ff-ff-ff-ff static

Useful Commands

Link Layer 5-9

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-10

Link layer introductionterminology hosts and routers

nodes communication

channels that connect adjacent nodes along communication path links wired links wireless links LANs

layer-2 packet frame encapsulates datagramdata-link layer has responsibility of

transferring datagram from one node to physically adjacent node over a link

global ISP

Link Layer 5-11

Link layer context datagram transferred

by different link protocols over different links eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg may or may not

provide rdt over link

framing link access encapsulate datagram

into frame adding header trailer

channel access if shared medium

ldquoMACrdquo addresses used in frame headers to identify source dest bull different from IP

address

reliable delivery between adjacent nodeswe learned how to do this already ndash Transport layerseldom used on low bit-error link (fiber some twisted pair)wireless links high error rates

Q why both link-level and end-end reliability

Link Layer 5-12

flow control pacing between adjacent sending and receiving

nodes error detection

errors caused by signal attenuation noise receiver detects presence of errors

bull signals sender for retransmission or drops frame error correction

receiver identifies and corrects bit error(s) without resorting to retransmission

half-duplex and full-duplex with half duplex nodes at both ends of link can

transmit but not at same time

Link layer services (more)

Link Layer 5-13

Where is the link layer implemented in each and every host link layer implemented

in ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card

80211 card Ethernet chipset

implements link physical layer

attaches into hostrsquos system buses

combination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

Link Layer 5-14

Link layer LANs outline51 introduction services52 error detection correction SKIPPED53 multiple access protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

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

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

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

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

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

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

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

transmit immediately collision probability increases

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

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

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

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

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

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

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

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

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

longer backoff interval with more collisions

Link Layer 5-28

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

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

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

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

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

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

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

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

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

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

address (unicast)

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

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

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

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

111111111112

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

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

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

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

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

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

111111111112

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

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

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

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

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

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

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

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

111111111112

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

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

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

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

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

111111111112

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

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

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

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

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

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

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

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

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

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 5: Lecture 13

Network Layer 4-5

Net services commands (Netexe) Performs a broad range of network tasks Type net with no parameters to see a full list of available command-line options

CUsersjbgtnet helpThe syntax of this command is

Commands available are

NET ACCOUNTS NET HELPMSG NET STATISTICS NET COMPUTER NET LOCALGROUP NET STOP NET CONFIG NET PAUSE NET TIME NET CONTINUE NET SESSION NET USE NET FILE NET SHARE NET USER NET GROUP NET START NET VIEW NET HELP

NET HELP NAMES explains different types of names in NET HELP syntax lines

NET HELP SERVICES lists some of the services you can start NET HELP SYNTAX explains how to read NET HELP syntax lines NET HELP command | MORE displays Help one screen at a time

Useful Commands

Network Layer 4-6

Netstat (Netstatexe) Displays active TCP connections ports on which the computer is listening Ethernet statistics the IP routing table and IPv4IPv6 statistics

CUsersjbgtnetstat

Proto Local Address Foreign Address State TCP 1270011029 jb-laptop5354 ESTABLISHED TCP 1270011036 jb-laptop27015 ESTABLISHED TCP 1270011047 jb-laptop19872 ESTABLISHED TCP 12700139055 jb-laptop39054 ESTABLISHED TCP 172171681382492 blugro5relay2492 ESTABLISHED

CUsersjbgtnetstat -sIPv4 Statistics Packets Received = 10158258 Received Header Errors = 2848 Received Address Errors = 2192434 Datagrams Forwarded = 0 Unknown Protocols Received = 170614 Received Packets Discarded = 4173788 Received Packets Delivered = 6692404

Useful Commands

Network Layer 4-7

Network Command Shell (Netshexe) Displays or modifies the network configuration of a local or remote computer that is currently running This command-line scripting utility has a huge number of options which are fully detailed in Help

TCPIP Route (Routeexe) Displays and modifies entries in the local IP routing table

CUsersjbgtroute printInterface List1360 36 dd aa 13 65 Intel(R) Centrino(R) Wireless-N 22301260 36 dd aa 13 69 Bluetooth Device (Personal Area Network)3108 00 27 00 e4 38 VirtualBox Host-Only Ethernet Adapter

IPv4 Route TableNetwork Destination Netmask Gateway Interface Metric 0000 0000 1721711 17217168138 25 127000 255000 On-link 127001 306 127001 255255255255 On-link 127001 306 127255255255 255255255255 On-link 127001 306 16925400 25525500 On-link 16925440182 276 16925440182 255255255255 On-link 16925440182 276 169254255255 255255255255 On-link 16925440182 276 1721700 25525500 On-link 17217168138 281 17217168138 255255255255 On-link 17217168138 281 17217255255 255255255255 On-link 17217168138 281 224000 240000 On-link 16925440182 276

Useful Commands

Network Layer 4-8

(Arpexe) Displays current ARP entries by interrogating the current protocol data If inet_addr is specified the IP and Physical addresses for only the specified computer are displayed If more than one network interface uses ARP entries for each ARP table are displayed

CUsersjbgtarp -a

Interface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527252 f0-1f-af-2f-e1-27 dynamic 1302152863 00-16-3e-c5-01-25 dynamic 13021529165 00-24-e8-32-32-1d dynamic 13021531255 ff-ff-ff-ff-ff-ff static

Useful Commands

Link Layer 5-9

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-10

Link layer introductionterminology hosts and routers

nodes communication

channels that connect adjacent nodes along communication path links wired links wireless links LANs

layer-2 packet frame encapsulates datagramdata-link layer has responsibility of

transferring datagram from one node to physically adjacent node over a link

global ISP

Link Layer 5-11

Link layer context datagram transferred

by different link protocols over different links eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg may or may not

provide rdt over link

framing link access encapsulate datagram

into frame adding header trailer

channel access if shared medium

ldquoMACrdquo addresses used in frame headers to identify source dest bull different from IP

address

reliable delivery between adjacent nodeswe learned how to do this already ndash Transport layerseldom used on low bit-error link (fiber some twisted pair)wireless links high error rates

Q why both link-level and end-end reliability

Link Layer 5-12

flow control pacing between adjacent sending and receiving

nodes error detection

errors caused by signal attenuation noise receiver detects presence of errors

bull signals sender for retransmission or drops frame error correction

receiver identifies and corrects bit error(s) without resorting to retransmission

half-duplex and full-duplex with half duplex nodes at both ends of link can

transmit but not at same time

Link layer services (more)

Link Layer 5-13

Where is the link layer implemented in each and every host link layer implemented

in ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card

80211 card Ethernet chipset

implements link physical layer

attaches into hostrsquos system buses

combination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

Link Layer 5-14

Link layer LANs outline51 introduction services52 error detection correction SKIPPED53 multiple access protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

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

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

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

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

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

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

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

transmit immediately collision probability increases

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

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

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

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

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

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

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

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

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

longer backoff interval with more collisions

Link Layer 5-28

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

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

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

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

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

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

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

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

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

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

address (unicast)

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

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

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

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

111111111112

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

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

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

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

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

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

111111111112

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

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

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

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

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

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

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

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

111111111112

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

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

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

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

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

111111111112

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

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

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

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

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

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

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

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

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

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 6: Lecture 13

Network Layer 4-6

Netstat (Netstatexe) Displays active TCP connections ports on which the computer is listening Ethernet statistics the IP routing table and IPv4IPv6 statistics

CUsersjbgtnetstat

Proto Local Address Foreign Address State TCP 1270011029 jb-laptop5354 ESTABLISHED TCP 1270011036 jb-laptop27015 ESTABLISHED TCP 1270011047 jb-laptop19872 ESTABLISHED TCP 12700139055 jb-laptop39054 ESTABLISHED TCP 172171681382492 blugro5relay2492 ESTABLISHED

CUsersjbgtnetstat -sIPv4 Statistics Packets Received = 10158258 Received Header Errors = 2848 Received Address Errors = 2192434 Datagrams Forwarded = 0 Unknown Protocols Received = 170614 Received Packets Discarded = 4173788 Received Packets Delivered = 6692404

Useful Commands

Network Layer 4-7

Network Command Shell (Netshexe) Displays or modifies the network configuration of a local or remote computer that is currently running This command-line scripting utility has a huge number of options which are fully detailed in Help

TCPIP Route (Routeexe) Displays and modifies entries in the local IP routing table

CUsersjbgtroute printInterface List1360 36 dd aa 13 65 Intel(R) Centrino(R) Wireless-N 22301260 36 dd aa 13 69 Bluetooth Device (Personal Area Network)3108 00 27 00 e4 38 VirtualBox Host-Only Ethernet Adapter

IPv4 Route TableNetwork Destination Netmask Gateway Interface Metric 0000 0000 1721711 17217168138 25 127000 255000 On-link 127001 306 127001 255255255255 On-link 127001 306 127255255255 255255255255 On-link 127001 306 16925400 25525500 On-link 16925440182 276 16925440182 255255255255 On-link 16925440182 276 169254255255 255255255255 On-link 16925440182 276 1721700 25525500 On-link 17217168138 281 17217168138 255255255255 On-link 17217168138 281 17217255255 255255255255 On-link 17217168138 281 224000 240000 On-link 16925440182 276

Useful Commands

Network Layer 4-8

(Arpexe) Displays current ARP entries by interrogating the current protocol data If inet_addr is specified the IP and Physical addresses for only the specified computer are displayed If more than one network interface uses ARP entries for each ARP table are displayed

CUsersjbgtarp -a

Interface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527252 f0-1f-af-2f-e1-27 dynamic 1302152863 00-16-3e-c5-01-25 dynamic 13021529165 00-24-e8-32-32-1d dynamic 13021531255 ff-ff-ff-ff-ff-ff static

Useful Commands

Link Layer 5-9

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-10

Link layer introductionterminology hosts and routers

nodes communication

channels that connect adjacent nodes along communication path links wired links wireless links LANs

layer-2 packet frame encapsulates datagramdata-link layer has responsibility of

transferring datagram from one node to physically adjacent node over a link

global ISP

Link Layer 5-11

Link layer context datagram transferred

by different link protocols over different links eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg may or may not

provide rdt over link

framing link access encapsulate datagram

into frame adding header trailer

channel access if shared medium

ldquoMACrdquo addresses used in frame headers to identify source dest bull different from IP

address

reliable delivery between adjacent nodeswe learned how to do this already ndash Transport layerseldom used on low bit-error link (fiber some twisted pair)wireless links high error rates

Q why both link-level and end-end reliability

Link Layer 5-12

flow control pacing between adjacent sending and receiving

nodes error detection

errors caused by signal attenuation noise receiver detects presence of errors

bull signals sender for retransmission or drops frame error correction

receiver identifies and corrects bit error(s) without resorting to retransmission

half-duplex and full-duplex with half duplex nodes at both ends of link can

transmit but not at same time

Link layer services (more)

Link Layer 5-13

Where is the link layer implemented in each and every host link layer implemented

in ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card

80211 card Ethernet chipset

implements link physical layer

attaches into hostrsquos system buses

combination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

Link Layer 5-14

Link layer LANs outline51 introduction services52 error detection correction SKIPPED53 multiple access protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

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

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

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

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

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

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

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

transmit immediately collision probability increases

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

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

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

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

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

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

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

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

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

longer backoff interval with more collisions

Link Layer 5-28

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

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

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

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

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

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

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

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

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

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

address (unicast)

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

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

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

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

111111111112

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

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

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

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

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

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

111111111112

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

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

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

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

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

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

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

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

111111111112

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

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

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

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

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

111111111112

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

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

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

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

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

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

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

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

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

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 7: Lecture 13

Network Layer 4-7

Network Command Shell (Netshexe) Displays or modifies the network configuration of a local or remote computer that is currently running This command-line scripting utility has a huge number of options which are fully detailed in Help

TCPIP Route (Routeexe) Displays and modifies entries in the local IP routing table

CUsersjbgtroute printInterface List1360 36 dd aa 13 65 Intel(R) Centrino(R) Wireless-N 22301260 36 dd aa 13 69 Bluetooth Device (Personal Area Network)3108 00 27 00 e4 38 VirtualBox Host-Only Ethernet Adapter

IPv4 Route TableNetwork Destination Netmask Gateway Interface Metric 0000 0000 1721711 17217168138 25 127000 255000 On-link 127001 306 127001 255255255255 On-link 127001 306 127255255255 255255255255 On-link 127001 306 16925400 25525500 On-link 16925440182 276 16925440182 255255255255 On-link 16925440182 276 169254255255 255255255255 On-link 16925440182 276 1721700 25525500 On-link 17217168138 281 17217168138 255255255255 On-link 17217168138 281 17217255255 255255255255 On-link 17217168138 281 224000 240000 On-link 16925440182 276

Useful Commands

Network Layer 4-8

(Arpexe) Displays current ARP entries by interrogating the current protocol data If inet_addr is specified the IP and Physical addresses for only the specified computer are displayed If more than one network interface uses ARP entries for each ARP table are displayed

CUsersjbgtarp -a

Interface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527252 f0-1f-af-2f-e1-27 dynamic 1302152863 00-16-3e-c5-01-25 dynamic 13021529165 00-24-e8-32-32-1d dynamic 13021531255 ff-ff-ff-ff-ff-ff static

Useful Commands

Link Layer 5-9

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-10

Link layer introductionterminology hosts and routers

nodes communication

channels that connect adjacent nodes along communication path links wired links wireless links LANs

layer-2 packet frame encapsulates datagramdata-link layer has responsibility of

transferring datagram from one node to physically adjacent node over a link

global ISP

Link Layer 5-11

Link layer context datagram transferred

by different link protocols over different links eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg may or may not

provide rdt over link

framing link access encapsulate datagram

into frame adding header trailer

channel access if shared medium

ldquoMACrdquo addresses used in frame headers to identify source dest bull different from IP

address

reliable delivery between adjacent nodeswe learned how to do this already ndash Transport layerseldom used on low bit-error link (fiber some twisted pair)wireless links high error rates

Q why both link-level and end-end reliability

Link Layer 5-12

flow control pacing between adjacent sending and receiving

nodes error detection

errors caused by signal attenuation noise receiver detects presence of errors

bull signals sender for retransmission or drops frame error correction

receiver identifies and corrects bit error(s) without resorting to retransmission

half-duplex and full-duplex with half duplex nodes at both ends of link can

transmit but not at same time

Link layer services (more)

Link Layer 5-13

Where is the link layer implemented in each and every host link layer implemented

in ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card

80211 card Ethernet chipset

implements link physical layer

attaches into hostrsquos system buses

combination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

Link Layer 5-14

Link layer LANs outline51 introduction services52 error detection correction SKIPPED53 multiple access protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

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

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

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

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

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

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

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

transmit immediately collision probability increases

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

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

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

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

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

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

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

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

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

longer backoff interval with more collisions

Link Layer 5-28

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

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

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

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

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

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

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

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

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

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

address (unicast)

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

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

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

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

111111111112

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

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

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

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

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

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

111111111112

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

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

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

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

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

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

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

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

111111111112

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

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

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

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

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

111111111112

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

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

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

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

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

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

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

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

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

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 8: Lecture 13

Network Layer 4-8

(Arpexe) Displays current ARP entries by interrogating the current protocol data If inet_addr is specified the IP and Physical addresses for only the specified computer are displayed If more than one network interface uses ARP entries for each ARP table are displayed

CUsersjbgtarp -a

Interface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527252 f0-1f-af-2f-e1-27 dynamic 1302152863 00-16-3e-c5-01-25 dynamic 13021529165 00-24-e8-32-32-1d dynamic 13021531255 ff-ff-ff-ff-ff-ff static

Useful Commands

Link Layer 5-9

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-10

Link layer introductionterminology hosts and routers

nodes communication

channels that connect adjacent nodes along communication path links wired links wireless links LANs

layer-2 packet frame encapsulates datagramdata-link layer has responsibility of

transferring datagram from one node to physically adjacent node over a link

global ISP

Link Layer 5-11

Link layer context datagram transferred

by different link protocols over different links eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg may or may not

provide rdt over link

framing link access encapsulate datagram

into frame adding header trailer

channel access if shared medium

ldquoMACrdquo addresses used in frame headers to identify source dest bull different from IP

address

reliable delivery between adjacent nodeswe learned how to do this already ndash Transport layerseldom used on low bit-error link (fiber some twisted pair)wireless links high error rates

Q why both link-level and end-end reliability

Link Layer 5-12

flow control pacing between adjacent sending and receiving

nodes error detection

errors caused by signal attenuation noise receiver detects presence of errors

bull signals sender for retransmission or drops frame error correction

receiver identifies and corrects bit error(s) without resorting to retransmission

half-duplex and full-duplex with half duplex nodes at both ends of link can

transmit but not at same time

Link layer services (more)

Link Layer 5-13

Where is the link layer implemented in each and every host link layer implemented

in ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card

80211 card Ethernet chipset

implements link physical layer

attaches into hostrsquos system buses

combination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

Link Layer 5-14

Link layer LANs outline51 introduction services52 error detection correction SKIPPED53 multiple access protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

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

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

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

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

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

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

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

transmit immediately collision probability increases

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

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

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

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

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

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

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

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

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

longer backoff interval with more collisions

Link Layer 5-28

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

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

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

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

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

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

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

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

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

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

address (unicast)

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

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

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

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

111111111112

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

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

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

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

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

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

111111111112

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

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

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

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

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

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

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

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

111111111112

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

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

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

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

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

111111111112

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

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

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

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

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

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

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

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

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

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 9: Lecture 13

Link Layer 5-9

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-10

Link layer introductionterminology hosts and routers

nodes communication

channels that connect adjacent nodes along communication path links wired links wireless links LANs

layer-2 packet frame encapsulates datagramdata-link layer has responsibility of

transferring datagram from one node to physically adjacent node over a link

global ISP

Link Layer 5-11

Link layer context datagram transferred

by different link protocols over different links eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg may or may not

provide rdt over link

framing link access encapsulate datagram

into frame adding header trailer

channel access if shared medium

ldquoMACrdquo addresses used in frame headers to identify source dest bull different from IP

address

reliable delivery between adjacent nodeswe learned how to do this already ndash Transport layerseldom used on low bit-error link (fiber some twisted pair)wireless links high error rates

Q why both link-level and end-end reliability

Link Layer 5-12

flow control pacing between adjacent sending and receiving

nodes error detection

errors caused by signal attenuation noise receiver detects presence of errors

bull signals sender for retransmission or drops frame error correction

receiver identifies and corrects bit error(s) without resorting to retransmission

half-duplex and full-duplex with half duplex nodes at both ends of link can

transmit but not at same time

Link layer services (more)

Link Layer 5-13

Where is the link layer implemented in each and every host link layer implemented

in ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card

80211 card Ethernet chipset

implements link physical layer

attaches into hostrsquos system buses

combination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

Link Layer 5-14

Link layer LANs outline51 introduction services52 error detection correction SKIPPED53 multiple access protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

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

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

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

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

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

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

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

transmit immediately collision probability increases

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

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

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

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

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

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

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

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

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

longer backoff interval with more collisions

Link Layer 5-28

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

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

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

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

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

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

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

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

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

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

address (unicast)

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

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

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

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

111111111112

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

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

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

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

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

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

111111111112

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

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

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

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

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

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

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

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

111111111112

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

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

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

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

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

111111111112

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

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

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

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

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

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

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

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

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

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 10: Lecture 13

Link Layer 5-10

Link layer introductionterminology hosts and routers

nodes communication

channels that connect adjacent nodes along communication path links wired links wireless links LANs

layer-2 packet frame encapsulates datagramdata-link layer has responsibility of

transferring datagram from one node to physically adjacent node over a link

global ISP

Link Layer 5-11

Link layer context datagram transferred

by different link protocols over different links eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg may or may not

provide rdt over link

framing link access encapsulate datagram

into frame adding header trailer

channel access if shared medium

ldquoMACrdquo addresses used in frame headers to identify source dest bull different from IP

address

reliable delivery between adjacent nodeswe learned how to do this already ndash Transport layerseldom used on low bit-error link (fiber some twisted pair)wireless links high error rates

Q why both link-level and end-end reliability

Link Layer 5-12

flow control pacing between adjacent sending and receiving

nodes error detection

errors caused by signal attenuation noise receiver detects presence of errors

bull signals sender for retransmission or drops frame error correction

receiver identifies and corrects bit error(s) without resorting to retransmission

half-duplex and full-duplex with half duplex nodes at both ends of link can

transmit but not at same time

Link layer services (more)

Link Layer 5-13

Where is the link layer implemented in each and every host link layer implemented

in ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card

80211 card Ethernet chipset

implements link physical layer

attaches into hostrsquos system buses

combination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

Link Layer 5-14

Link layer LANs outline51 introduction services52 error detection correction SKIPPED53 multiple access protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

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

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

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

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

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

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

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

transmit immediately collision probability increases

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

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

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

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

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

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

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

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

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

longer backoff interval with more collisions

Link Layer 5-28

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

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

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

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

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

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

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

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

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

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

address (unicast)

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

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

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

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

111111111112

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

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

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

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

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

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

111111111112

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

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

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

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

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

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

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

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

111111111112

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

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

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

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

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

111111111112

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

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

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

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

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

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

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

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

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

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 11: Lecture 13

Link Layer 5-11

Link layer context datagram transferred

by different link protocols over different links eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg may or may not

provide rdt over link

framing link access encapsulate datagram

into frame adding header trailer

channel access if shared medium

ldquoMACrdquo addresses used in frame headers to identify source dest bull different from IP

address

reliable delivery between adjacent nodeswe learned how to do this already ndash Transport layerseldom used on low bit-error link (fiber some twisted pair)wireless links high error rates

Q why both link-level and end-end reliability

Link Layer 5-12

flow control pacing between adjacent sending and receiving

nodes error detection

errors caused by signal attenuation noise receiver detects presence of errors

bull signals sender for retransmission or drops frame error correction

receiver identifies and corrects bit error(s) without resorting to retransmission

half-duplex and full-duplex with half duplex nodes at both ends of link can

transmit but not at same time

Link layer services (more)

Link Layer 5-13

Where is the link layer implemented in each and every host link layer implemented

in ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card

80211 card Ethernet chipset

implements link physical layer

attaches into hostrsquos system buses

combination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

Link Layer 5-14

Link layer LANs outline51 introduction services52 error detection correction SKIPPED53 multiple access protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

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

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

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

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

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

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

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

transmit immediately collision probability increases

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

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

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

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

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

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

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

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

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

longer backoff interval with more collisions

Link Layer 5-28

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

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

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

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

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

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

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

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

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

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

address (unicast)

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

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

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

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

111111111112

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

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

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

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

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

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

111111111112

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

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

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

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

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

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

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

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

111111111112

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

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

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

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

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

111111111112

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

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

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

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

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

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

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

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

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

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 12: Lecture 13

Link Layer 5-12

flow control pacing between adjacent sending and receiving

nodes error detection

errors caused by signal attenuation noise receiver detects presence of errors

bull signals sender for retransmission or drops frame error correction

receiver identifies and corrects bit error(s) without resorting to retransmission

half-duplex and full-duplex with half duplex nodes at both ends of link can

transmit but not at same time

Link layer services (more)

Link Layer 5-13

Where is the link layer implemented in each and every host link layer implemented

in ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card

80211 card Ethernet chipset

implements link physical layer

attaches into hostrsquos system buses

combination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

Link Layer 5-14

Link layer LANs outline51 introduction services52 error detection correction SKIPPED53 multiple access protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

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

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

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

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

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

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

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

transmit immediately collision probability increases

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

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

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

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

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

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

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

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

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

longer backoff interval with more collisions

Link Layer 5-28

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

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

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

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

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

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

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

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

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

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

address (unicast)

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

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

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

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

111111111112

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

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

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

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

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

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

111111111112

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

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

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

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

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

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

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

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

111111111112

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

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

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

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

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

111111111112

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

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

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

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

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

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

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

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

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

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 13: Lecture 13

Link Layer 5-13

Where is the link layer implemented in each and every host link layer implemented

in ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card

80211 card Ethernet chipset

implements link physical layer

attaches into hostrsquos system buses

combination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

Link Layer 5-14

Link layer LANs outline51 introduction services52 error detection correction SKIPPED53 multiple access protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

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

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

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

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

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

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

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

transmit immediately collision probability increases

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

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

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

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

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

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

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

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

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

longer backoff interval with more collisions

Link Layer 5-28

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

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

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

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

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

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

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

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

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

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

address (unicast)

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

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

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

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

111111111112

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

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

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

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

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

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

111111111112

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

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

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

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

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

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

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

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

111111111112

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

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

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

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

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

111111111112

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

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

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

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

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

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

111111111112

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

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

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

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

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

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

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

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

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

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 14: Lecture 13

Link Layer 5-14

Link layer LANs outline51 introduction services52 error detection correction SKIPPED53 multiple access protocols54 LANs

addressing ARP Ethernet switches VLANS

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

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

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

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

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

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

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

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

transmit immediately collision probability increases

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

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

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

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision

NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 15: Lecture 13

Link Layer 5-15

Multiple access links protocolstwo types of ldquolinksrdquo point-to-point NO

Collisions PPP for dial-up access point-to-point link between Ethernet switch host

broadcast (shared wire or medium) Collisions old-fashioned Ethernet upstream HFC 80211 wireless LAN algorithm that determines how nodes share

channel

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquotaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability increases

frame sent at t0 collides with other frames sent in [t0-1t0+1]

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision

NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 16: Lecture 13

Link Layer 5-16

MAC protocols taxonomythree broad classes of sharing channel partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use Subdividing the capacity ndash TDM FDM

random access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquotaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability increases

frame sent at t0 collides with other frames sent in [t0-1t0+1]

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision

NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 17: Lecture 13

Link Layer 5-17

Random access protocols when node has packet to send

transmit at full channel data rate R no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability increases

frame sent at t0 collides with other frames sent in [t0-1t0+1]

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision

NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 18: Lecture 13

Link Layer 5-18

Slotted ALOHAassumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability increases

frame sent at t0 collides with other frames sent in [t0-1t0+1]

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision

NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 19: Lecture 13

Link Layer 5-19

Pros single active node

can continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able

to detect collision in less than time to transmit packet

clock synchronization

Slotted ALOHA1 1 1 1

2

3

2 2

3 3

node 1

node 2

node 3

C C CS S SE E E

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability increases

frame sent at t0 collides with other frames sent in [t0-1t0+1]

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision

NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 20: Lecture 13

Link Layer 5-20

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

max efficiency = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability increases

frame sent at t0 collides with other frames sent in [t0-1t0+1]

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision

NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 21: Lecture 13

Link Layer 5-21

max efficiency find p that maximizes F(p) = Np(1-p)N-1

max efficiency when Frsquo(p) = 0dFdp = d (Np(1-p)N-1 ) dp = N(1-p)N-1 + Np(N-1)(-1)(1-p)N-2

N(1-p)N-1 = Np(N-1)(1-p)N-1 (1 ndash p) 1 = p(N ndash 1) ( 1 ndash p)( 1 ndash p ) = p ( N ndash 1) = pN - p 1 = pN p = 1 N

F(max) = N(1N)(1-(1N))N-1

= ( 1 ndash 1N ) N-1

As N goes to infinity F(max) = 1 e = 037

Slotted ALOHA efficiency

Link Layer 5-22

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability increases

frame sent at t0 collides with other frames sent in [t0-1t0+1]

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision

NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 22: Lecture 13

Link Layer 5-22

Pure (unslotted) ALOHA unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately collision probability increases

frame sent at t0 collides with other frames sent in [t0-1t0+1]

Efficiency of only 018

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision

NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 23: Lecture 13

Link Layer 5-23

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-24

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision

NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 24: Lecture 13

Link Layer 5-24

CSMA collisions collisions can still

occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wasted distance amp

propagation delay play role in determining collision probability

spatial layout of nodes

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision

NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 25: Lecture 13

Link Layer 5-25

CSMACD (collision detection)CSMACD carrier sensing deferral as in

CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision

NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 26: Lecture 13

Link Layer 5-26

CSMACD (collision detection)

spatial layout of nodes

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision

NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 27: Lecture 13

Link Layer 5-27

Ethernet CSMACD algorithm1 NIC receives

datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff after mth collision

NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

longer backoff interval with more collisions

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 28: Lecture 13

Link Layer 5-28

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 as tprop goes to 0 as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 29: Lecture 13

Link Layer 5-29

token passing control token

passed from one node to next sequentially

token message concerns

token overhead latency single point of

failure (token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 30: Lecture 13

cable headend

CMTS

ISP

cable modemtermination system

multiple 40Mbps downstream (broadcast) channels single CMTS transmits into channels

multiple 30 Mbps upstream channels multiple access all users contend for certain

upstream channel time slots (others assigned)

Cable access network

cablemodemsplitter

hellip

hellip

Internet framesTV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 31: Lecture 13

Link Layer 5-31

DOCSIS data over cable service interface spec

FDM over upstream downstream frequency channels

TDM upstream some slots assigned some have contention downstream MAP frame assigns upstream

slots request for upstream slots (and data)

transmitted random access (binary backoff) in selected slots

MAP frame forInterval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modemupstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 32: Lecture 13

Link Layer 5-32

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 33: Lecture 13

Link Layer 5-33

MAC addresses and ARP 32-bit IP address

network-layer address for interface used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one

interface to another physically-connected interface (same network in IP-addressing sense)

48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 34: Lecture 13

Link Layer 5-34

LAN addresses and ARPeach adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 35: Lecture 13

Link Layer 5-35

LAN addresses (more) MAC address allocation administered by

IEEE manufacturer buys portion of MAC

address space (to assure uniqueness) analogy

MAC address like Social Security Number IP address like postal address

MAC flat address portability can move LAN card from one LAN to

another IP hierarchical address not portable

address depends on IP subnet to which node is attached

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 36: Lecture 13

Link Layer 5-36

ARP address resolution protocol ARP table each IP node

(host router) on LAN has 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 to determineinterfacersquos 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-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 37: Lecture 13

Link Layer 5-37

ARP address resolution protocol

Question how to determineinterfacersquos MAC address knowing its IP address

ipconfig allEthernet adapter Local Area Connection

Connection-specific DNS Suffix WPIEDU Description Realtek PCIe FE Controller Physical Address B8-CA-3A-DC-C6-2B DHCP Enabled Yes Autoconfiguration Enabled Yes IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480 Lease Obtained MondayDecember 16 2013 110643 AM Lease Expires MondayDecember 16 2013 50643 PM Default Gateway 130215241 DHCP Server 1302153918 DNS Servers 1302153218 1302153918 130215518 NetBIOS over Tcpip Enabled

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 38: Lecture 13

Link Layer 5-38

ARP protocol same LAN A wants to send

datagram to B 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 nodes on LAN

receive ARP query B receives ARP

packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their

ARP tables without intervention from net administrator

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 39: Lecture 13

Link Layer 5-39

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame)

assume A knows Brsquos IP address assume A knows IP address of first hop router R (how)

assume A knows Rrsquos MAC address (how)

Addressing routing to another LAN

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 40: Lecture 13

Link Layer 5-40

Addressing routing to another LAN

ipconfig all Physical Address B8-CA-3A-DC-C6-2B IPv4 Address 1302152836(Preferred) Subnet Mask 2552552480

getmacPhysical Address Transport Name=================== ====================B8-CA-3A-DC-C6-2B DeviceTcpip_ Wired08-00-27-00-E4-38 DeviceTcpip_ Wireless

arp -aInterface 1302152836 --- 0x10 Internet Address Physical Address Type 130215241 00-00-5e-00-01-01 dynamic 130215242 00-23-9c-94-97-f0 dynamic 13021527230 f0-1f-af-2f-e1-3f dynamic 13021529193 04-7d-7b-b0-b1-44 dynamic

route printActive RoutesNetwork Destination Netmask Gateway Interface Metric 0000 0000 130215241 1302152836 20 127255255255 255255255255 On-link 127001 306 130215240 2552552480 On-link 1302152836 276 1302152836 255255255255 On-link 1302152836 276 13021531255 255255255255 On-link 1302152836 276

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 41: Lecture 13

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-41

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 42: Lecture 13

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-42

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 43: Lecture 13

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-43

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with 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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 44: Lecture 13

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-44

Addressing routing to another LAN

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

IPEthPhy

IPEthPhy

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 45: Lecture 13

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-45

Addressing routing to another LAN

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

IPEthPhy

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 46: Lecture 13

Link Layer 5-46

Link layer LANs outline51 introduction

services52 error detection

correction 53 multiple access

protocols54 LANs

addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 47: Lecture 13

Link Layer 5-47

Ethernetldquodominantrdquo 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

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 48: Lecture 13

Link Layer 5-48

Ethernet physical topology bus popular through mid 90s

all nodes in same collision domain (can collide with each other)

star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet

protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 49: Lecture 13

Link Layer 5-49

Ethernet frame structuresending 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 50: Lecture 13

Link Layer 5-50

Ethernet frame structure (more) addresses 6 byte source destination MAC

addresses 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 cyclic redundancy check at receiver error detected frame is droppeddest

addresssource

addressdata

(payload) CRCpreamble

type

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 51: Lecture 13

Link Layer 5-51

Ethernet unreliable connectionless connectionless no handshaking between

sending and receiving NICs unreliable receiving NIC doesnrsquot send acks

or nacks to sending NIC data in dropped frames recovered only if

initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost

Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 52: Lecture 13

Link Layer 5-52

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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near
Page 53: Lecture 13

The End is Near

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services (more)
  • Where is the link layer implemented
  • Link layer LANs outline (2)
  • Multiple access links protocols
  • MAC protocols taxonomy
  • Random access protocols
  • Slotted ALOHA
  • Slotted ALOHA (2)
  • Slotted ALOHA efficiency
  • Slotted ALOHA efficiency (2)
  • Pure (unslotted) ALOHA
  • CSMA (carrier sense multiple access)
  • CSMA collisions
  • CSMACD (collision detection)
  • CSMACD (collision detection) (2)
  • Ethernet CSMACD algorithm
  • CSMACD efficiency
  • ldquoTaking turnsrdquo MAC protocols
  • Slide 30
  • Slide 31
  • Link layer LANs outline (3)
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP address resolution protocol (2)
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Addressing routing to another LAN (2)
  • Addressing routing to another LAN (3)
  • Addressing routing to another LAN (4)
  • Addressing routing to another LAN (5)
  • Addressing routing to another LAN (6)
  • Addressing routing to another LAN (7)
  • Link layer LANs outline (4)
  • Ethernet
  • Ethernet physical topology
  • Ethernet frame structure
  • Ethernet frame structure (more)
  • Ethernet unreliable connectionless
  • 8023 Ethernet standards link amp physical layers
  • The End is Near