EC441 Spring 2020 Introduction to Computer Networking...

71
EC441 Ch6 - 1 This presentation is adapted from slides produced by Jim Kurose and Keith Ross for their book, “Computer Networking: A Top Down Approach” and is used with permission of the authors as expressed on the original PowerPoint documents That material is copyright 1996-2016 J.F Kurose and K.W. Ross, All Rights Reserved Slides produced by Prof Carruthers are marked as such. All other slides are adapted from or the same as the originals by Kurose and Ross. Chapter 6: The Link Layer and LANs 1 EC441 Spring 2020 Introduction to Computer Networking

Transcript of EC441 Spring 2020 Introduction to Computer Networking...

Page 1: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 1

This presentation is adapted from slides produced by Jim Kurose and Keith Ross for their book ldquoComputer Networking A Top Down Approachrdquo and is used with permission of the authors as expressed on the original PowerPoint documents

That material is copyright 1996-2016 JF Kurose and KW Ross All Rights Reserved

Slides produced by Prof Carruthers are marked as such All other slides are adapted from or the same as the originals by Kurose and Ross

Chapter 6 The Link Layer and LANs

1

EC441 Spring 2020Introduction to Computer Networking

EC441 Ch6 - 2

our goals understand principles behind link layer services

bull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressingbull local area networks Ethernet VLANs

instantiation implementation of various link layer technologies

Chapter 6 Link layer and LANs

EC441 Ch6 - 3

terminology hosts and routers nodes communication channels that

connect adjacent nodes along communication path linksbull wired linksbull wireless linksbull LANs

layer-2 packet frame encapsulates datagram

data-link layer has responsibility of transferring datagram from one node to physically adjacent node over a link

Link layer introduction

EC441 Ch6 - 4

datagram transferred by different link protocols over different linksbull eg Ethernet on first

link frame relay on intermediate links 80211 on last link

each link protocol provides different servicesbull eg may or may not

provide rdt over link

transportation analogy trip from Princeton to Lausanne

bull limo Princeton to JFKbull plane JFK to Genevabull train Geneva to Lausanne

tourist = datagram transport segment =

communication link transportation mode = link

layer protocol travel agent = routing

algorithm

Link layer context

EC441 Ch6 - 5

framing link access bull encapsulate datagram into frame adding header trailerbull channel access if shared mediumbull ldquoMACrdquo addresses used in frame headers to identify

source destination different from IP address

reliable delivery between adjacent nodesbull we learned how to do this already (chapter 3)bull seldom used on low bit-error link (fiber some twisted

pair)bull wireless links high error rates Q why both link-level and end-end reliability

Link layer services

EC441 Ch6 - 6

flow control bull pacing between adjacent sending and receiving nodes

error detection bull errors caused by signal attenuation noise bull receiver detects presence of errors signals sender for retransmission or drops frame

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

retransmission half-duplex and full-duplex

bull with half duplex nodes at both ends of link can transmit but not at same time

Link layer services (more)

EC441 Ch6 - 7

in each and every host link layer implemented in

ldquoadaptorrdquo (aka network interface card NIC) or on a chipbull Ethernet card 80211

card Ethernet chipsetbull implements link physical

layer attaches into hostrsquos system

buses combination of hardware

software firmware

controller

physical transmission

cpu memory

host bus (eg PCI)

network adapter card

application transport network

link

link physical

Where is the link layer implemented

EC441 Ch6 - 8

sending sidebull encapsulates datagram

in framebull adds error checking

bits rdt flow control etc

receiving sidebull looks for errors rdt flow

control etcbull extracts datagram passes to

upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

Adaptors communicating

EC441 Ch6 - 9

two types of ldquolinksrdquo point-to-point

bull PPP for dial-up accessbull point-to-point link between Ethernet switch host

broadcast (shared wire or medium)bull old-fashioned Ethernetbull upstream HFCbull 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF (satellite)

humans at a cocktail party

(shared air acoustical)

Multiple access links protocols

EC441 Ch6 - 10

single shared broadcast channel two or more simultaneous transmissions by nodes

interference bull collision if node receives two or more signals at the

same time

multiple access protocol distributed algorithm that determines how nodes share

channel ie determine when node can transmit communication about channel sharing must use channel

itself bull no out-of-band channel for coordination

Multiple access protocols

EC441 Ch6 - 11

given broadcast channel of rate R bps

goals1 when one node wants to transmit it can send at rate R2 when M nodes want to transmit each can send at average

rate RM3 fully decentralized no special node to coordinate transmissions no synchronization of clocks slots

4 simple

An ideal multiple access protocol

EC441 Ch6 - 12

three broad classes channel partitioning

bull divide channel into smaller ldquopiecesrdquo (time slots frequency code)bull allocate piece to node for exclusive use

random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

MAC protocols taxonomy

EC441 Ch6 - 13

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = packet transmission

time) in each round unused slots go idle example 6-station LAN 134 have packets to send slots 256

idle

1 3 4 1 3 4

6-slot frame

6-slot frame

Channel partitioning MAC protocols TDMA

EC441 Ch6 - 14

FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example 6-station LAN 134 have packet to send

frequency bands 256 idle

frequ

ency

ban

dstime

FDM cable

Channel partitioning MAC protocols FDMA

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

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

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

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

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

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

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

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

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

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

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

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

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

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

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

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

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

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

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

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

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

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

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

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

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

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

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

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

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

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

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

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

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

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

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

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

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

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

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

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

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

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

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

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

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

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

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

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

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

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

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

MAC (LAN) addresses

EC441 Ch6 - 52

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

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

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

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

57

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 destination

address frame contains A-to-B IP datagram

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

58

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

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 2: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 2

our goals understand principles behind link layer services

bull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressingbull local area networks Ethernet VLANs

instantiation implementation of various link layer technologies

Chapter 6 Link layer and LANs

EC441 Ch6 - 3

terminology hosts and routers nodes communication channels that

connect adjacent nodes along communication path linksbull wired linksbull wireless linksbull LANs

layer-2 packet frame encapsulates datagram

data-link layer has responsibility of transferring datagram from one node to physically adjacent node over a link

Link layer introduction

EC441 Ch6 - 4

datagram transferred by different link protocols over different linksbull eg Ethernet on first

link frame relay on intermediate links 80211 on last link

each link protocol provides different servicesbull eg may or may not

provide rdt over link

transportation analogy trip from Princeton to Lausanne

bull limo Princeton to JFKbull plane JFK to Genevabull train Geneva to Lausanne

tourist = datagram transport segment =

communication link transportation mode = link

layer protocol travel agent = routing

algorithm

Link layer context

EC441 Ch6 - 5

framing link access bull encapsulate datagram into frame adding header trailerbull channel access if shared mediumbull ldquoMACrdquo addresses used in frame headers to identify

source destination different from IP address

reliable delivery between adjacent nodesbull we learned how to do this already (chapter 3)bull seldom used on low bit-error link (fiber some twisted

pair)bull wireless links high error rates Q why both link-level and end-end reliability

Link layer services

EC441 Ch6 - 6

flow control bull pacing between adjacent sending and receiving nodes

error detection bull errors caused by signal attenuation noise bull receiver detects presence of errors signals sender for retransmission or drops frame

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

retransmission half-duplex and full-duplex

bull with half duplex nodes at both ends of link can transmit but not at same time

Link layer services (more)

EC441 Ch6 - 7

in each and every host link layer implemented in

ldquoadaptorrdquo (aka network interface card NIC) or on a chipbull Ethernet card 80211

card Ethernet chipsetbull implements link physical

layer attaches into hostrsquos system

buses combination of hardware

software firmware

controller

physical transmission

cpu memory

host bus (eg PCI)

network adapter card

application transport network

link

link physical

Where is the link layer implemented

EC441 Ch6 - 8

sending sidebull encapsulates datagram

in framebull adds error checking

bits rdt flow control etc

receiving sidebull looks for errors rdt flow

control etcbull extracts datagram passes to

upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

Adaptors communicating

EC441 Ch6 - 9

two types of ldquolinksrdquo point-to-point

bull PPP for dial-up accessbull point-to-point link between Ethernet switch host

broadcast (shared wire or medium)bull old-fashioned Ethernetbull upstream HFCbull 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF (satellite)

humans at a cocktail party

(shared air acoustical)

Multiple access links protocols

EC441 Ch6 - 10

single shared broadcast channel two or more simultaneous transmissions by nodes

interference bull collision if node receives two or more signals at the

same time

multiple access protocol distributed algorithm that determines how nodes share

channel ie determine when node can transmit communication about channel sharing must use channel

itself bull no out-of-band channel for coordination

Multiple access protocols

EC441 Ch6 - 11

given broadcast channel of rate R bps

goals1 when one node wants to transmit it can send at rate R2 when M nodes want to transmit each can send at average

rate RM3 fully decentralized no special node to coordinate transmissions no synchronization of clocks slots

4 simple

An ideal multiple access protocol

EC441 Ch6 - 12

three broad classes channel partitioning

bull divide channel into smaller ldquopiecesrdquo (time slots frequency code)bull allocate piece to node for exclusive use

random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

MAC protocols taxonomy

EC441 Ch6 - 13

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = packet transmission

time) in each round unused slots go idle example 6-station LAN 134 have packets to send slots 256

idle

1 3 4 1 3 4

6-slot frame

6-slot frame

Channel partitioning MAC protocols TDMA

EC441 Ch6 - 14

FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example 6-station LAN 134 have packet to send

frequency bands 256 idle

frequ

ency

ban

dstime

FDM cable

Channel partitioning MAC protocols FDMA

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

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

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

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

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

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

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

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

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

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

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

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

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

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

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

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

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

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

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

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

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

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

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

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

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

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

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

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

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

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

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

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

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

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

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

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

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

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

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

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

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

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

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

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

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

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

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

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

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

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

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

MAC (LAN) addresses

EC441 Ch6 - 52

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

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

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

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

57

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 destination

address frame contains A-to-B IP datagram

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

58

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

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 3: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 3

terminology hosts and routers nodes communication channels that

connect adjacent nodes along communication path linksbull wired linksbull wireless linksbull LANs

layer-2 packet frame encapsulates datagram

data-link layer has responsibility of transferring datagram from one node to physically adjacent node over a link

Link layer introduction

EC441 Ch6 - 4

datagram transferred by different link protocols over different linksbull eg Ethernet on first

link frame relay on intermediate links 80211 on last link

each link protocol provides different servicesbull eg may or may not

provide rdt over link

transportation analogy trip from Princeton to Lausanne

bull limo Princeton to JFKbull plane JFK to Genevabull train Geneva to Lausanne

tourist = datagram transport segment =

communication link transportation mode = link

layer protocol travel agent = routing

algorithm

Link layer context

EC441 Ch6 - 5

framing link access bull encapsulate datagram into frame adding header trailerbull channel access if shared mediumbull ldquoMACrdquo addresses used in frame headers to identify

source destination different from IP address

reliable delivery between adjacent nodesbull we learned how to do this already (chapter 3)bull seldom used on low bit-error link (fiber some twisted

pair)bull wireless links high error rates Q why both link-level and end-end reliability

Link layer services

EC441 Ch6 - 6

flow control bull pacing between adjacent sending and receiving nodes

error detection bull errors caused by signal attenuation noise bull receiver detects presence of errors signals sender for retransmission or drops frame

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

retransmission half-duplex and full-duplex

bull with half duplex nodes at both ends of link can transmit but not at same time

Link layer services (more)

EC441 Ch6 - 7

in each and every host link layer implemented in

ldquoadaptorrdquo (aka network interface card NIC) or on a chipbull Ethernet card 80211

card Ethernet chipsetbull implements link physical

layer attaches into hostrsquos system

buses combination of hardware

software firmware

controller

physical transmission

cpu memory

host bus (eg PCI)

network adapter card

application transport network

link

link physical

Where is the link layer implemented

EC441 Ch6 - 8

sending sidebull encapsulates datagram

in framebull adds error checking

bits rdt flow control etc

receiving sidebull looks for errors rdt flow

control etcbull extracts datagram passes to

upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

Adaptors communicating

EC441 Ch6 - 9

two types of ldquolinksrdquo point-to-point

bull PPP for dial-up accessbull point-to-point link between Ethernet switch host

broadcast (shared wire or medium)bull old-fashioned Ethernetbull upstream HFCbull 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF (satellite)

humans at a cocktail party

(shared air acoustical)

Multiple access links protocols

EC441 Ch6 - 10

single shared broadcast channel two or more simultaneous transmissions by nodes

interference bull collision if node receives two or more signals at the

same time

multiple access protocol distributed algorithm that determines how nodes share

channel ie determine when node can transmit communication about channel sharing must use channel

itself bull no out-of-band channel for coordination

Multiple access protocols

EC441 Ch6 - 11

given broadcast channel of rate R bps

goals1 when one node wants to transmit it can send at rate R2 when M nodes want to transmit each can send at average

rate RM3 fully decentralized no special node to coordinate transmissions no synchronization of clocks slots

4 simple

An ideal multiple access protocol

EC441 Ch6 - 12

three broad classes channel partitioning

bull divide channel into smaller ldquopiecesrdquo (time slots frequency code)bull allocate piece to node for exclusive use

random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

MAC protocols taxonomy

EC441 Ch6 - 13

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = packet transmission

time) in each round unused slots go idle example 6-station LAN 134 have packets to send slots 256

idle

1 3 4 1 3 4

6-slot frame

6-slot frame

Channel partitioning MAC protocols TDMA

EC441 Ch6 - 14

FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example 6-station LAN 134 have packet to send

frequency bands 256 idle

frequ

ency

ban

dstime

FDM cable

Channel partitioning MAC protocols FDMA

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

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

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

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

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

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

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

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

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

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

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

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

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

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

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

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

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

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

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

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

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

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

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

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

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

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

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

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

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

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

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

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

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

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

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

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

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

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

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

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

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

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

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

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

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

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

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

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

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

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

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

MAC (LAN) addresses

EC441 Ch6 - 52

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

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

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

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

57

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 destination

address frame contains A-to-B IP datagram

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

58

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

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 4: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 4

datagram transferred by different link protocols over different linksbull eg Ethernet on first

link frame relay on intermediate links 80211 on last link

each link protocol provides different servicesbull eg may or may not

provide rdt over link

transportation analogy trip from Princeton to Lausanne

bull limo Princeton to JFKbull plane JFK to Genevabull train Geneva to Lausanne

tourist = datagram transport segment =

communication link transportation mode = link

layer protocol travel agent = routing

algorithm

Link layer context

EC441 Ch6 - 5

framing link access bull encapsulate datagram into frame adding header trailerbull channel access if shared mediumbull ldquoMACrdquo addresses used in frame headers to identify

source destination different from IP address

reliable delivery between adjacent nodesbull we learned how to do this already (chapter 3)bull seldom used on low bit-error link (fiber some twisted

pair)bull wireless links high error rates Q why both link-level and end-end reliability

Link layer services

EC441 Ch6 - 6

flow control bull pacing between adjacent sending and receiving nodes

error detection bull errors caused by signal attenuation noise bull receiver detects presence of errors signals sender for retransmission or drops frame

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

retransmission half-duplex and full-duplex

bull with half duplex nodes at both ends of link can transmit but not at same time

Link layer services (more)

EC441 Ch6 - 7

in each and every host link layer implemented in

ldquoadaptorrdquo (aka network interface card NIC) or on a chipbull Ethernet card 80211

card Ethernet chipsetbull implements link physical

layer attaches into hostrsquos system

buses combination of hardware

software firmware

controller

physical transmission

cpu memory

host bus (eg PCI)

network adapter card

application transport network

link

link physical

Where is the link layer implemented

EC441 Ch6 - 8

sending sidebull encapsulates datagram

in framebull adds error checking

bits rdt flow control etc

receiving sidebull looks for errors rdt flow

control etcbull extracts datagram passes to

upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

Adaptors communicating

EC441 Ch6 - 9

two types of ldquolinksrdquo point-to-point

bull PPP for dial-up accessbull point-to-point link between Ethernet switch host

broadcast (shared wire or medium)bull old-fashioned Ethernetbull upstream HFCbull 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF (satellite)

humans at a cocktail party

(shared air acoustical)

Multiple access links protocols

EC441 Ch6 - 10

single shared broadcast channel two or more simultaneous transmissions by nodes

interference bull collision if node receives two or more signals at the

same time

multiple access protocol distributed algorithm that determines how nodes share

channel ie determine when node can transmit communication about channel sharing must use channel

itself bull no out-of-band channel for coordination

Multiple access protocols

EC441 Ch6 - 11

given broadcast channel of rate R bps

goals1 when one node wants to transmit it can send at rate R2 when M nodes want to transmit each can send at average

rate RM3 fully decentralized no special node to coordinate transmissions no synchronization of clocks slots

4 simple

An ideal multiple access protocol

EC441 Ch6 - 12

three broad classes channel partitioning

bull divide channel into smaller ldquopiecesrdquo (time slots frequency code)bull allocate piece to node for exclusive use

random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

MAC protocols taxonomy

EC441 Ch6 - 13

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = packet transmission

time) in each round unused slots go idle example 6-station LAN 134 have packets to send slots 256

idle

1 3 4 1 3 4

6-slot frame

6-slot frame

Channel partitioning MAC protocols TDMA

EC441 Ch6 - 14

FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example 6-station LAN 134 have packet to send

frequency bands 256 idle

frequ

ency

ban

dstime

FDM cable

Channel partitioning MAC protocols FDMA

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

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

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

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

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

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

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

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

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

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

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

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

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

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

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

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

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

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

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

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

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

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

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

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

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

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

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

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

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

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

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

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

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

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

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

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

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

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

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

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

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

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

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

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

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

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

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

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

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

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

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

MAC (LAN) addresses

EC441 Ch6 - 52

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

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

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

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

57

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 destination

address frame contains A-to-B IP datagram

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

58

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

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 5: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 5

framing link access bull encapsulate datagram into frame adding header trailerbull channel access if shared mediumbull ldquoMACrdquo addresses used in frame headers to identify

source destination different from IP address

reliable delivery between adjacent nodesbull we learned how to do this already (chapter 3)bull seldom used on low bit-error link (fiber some twisted

pair)bull wireless links high error rates Q why both link-level and end-end reliability

Link layer services

EC441 Ch6 - 6

flow control bull pacing between adjacent sending and receiving nodes

error detection bull errors caused by signal attenuation noise bull receiver detects presence of errors signals sender for retransmission or drops frame

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

retransmission half-duplex and full-duplex

bull with half duplex nodes at both ends of link can transmit but not at same time

Link layer services (more)

EC441 Ch6 - 7

in each and every host link layer implemented in

ldquoadaptorrdquo (aka network interface card NIC) or on a chipbull Ethernet card 80211

card Ethernet chipsetbull implements link physical

layer attaches into hostrsquos system

buses combination of hardware

software firmware

controller

physical transmission

cpu memory

host bus (eg PCI)

network adapter card

application transport network

link

link physical

Where is the link layer implemented

EC441 Ch6 - 8

sending sidebull encapsulates datagram

in framebull adds error checking

bits rdt flow control etc

receiving sidebull looks for errors rdt flow

control etcbull extracts datagram passes to

upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

Adaptors communicating

EC441 Ch6 - 9

two types of ldquolinksrdquo point-to-point

bull PPP for dial-up accessbull point-to-point link between Ethernet switch host

broadcast (shared wire or medium)bull old-fashioned Ethernetbull upstream HFCbull 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF (satellite)

humans at a cocktail party

(shared air acoustical)

Multiple access links protocols

EC441 Ch6 - 10

single shared broadcast channel two or more simultaneous transmissions by nodes

interference bull collision if node receives two or more signals at the

same time

multiple access protocol distributed algorithm that determines how nodes share

channel ie determine when node can transmit communication about channel sharing must use channel

itself bull no out-of-band channel for coordination

Multiple access protocols

EC441 Ch6 - 11

given broadcast channel of rate R bps

goals1 when one node wants to transmit it can send at rate R2 when M nodes want to transmit each can send at average

rate RM3 fully decentralized no special node to coordinate transmissions no synchronization of clocks slots

4 simple

An ideal multiple access protocol

EC441 Ch6 - 12

three broad classes channel partitioning

bull divide channel into smaller ldquopiecesrdquo (time slots frequency code)bull allocate piece to node for exclusive use

random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

MAC protocols taxonomy

EC441 Ch6 - 13

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = packet transmission

time) in each round unused slots go idle example 6-station LAN 134 have packets to send slots 256

idle

1 3 4 1 3 4

6-slot frame

6-slot frame

Channel partitioning MAC protocols TDMA

EC441 Ch6 - 14

FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example 6-station LAN 134 have packet to send

frequency bands 256 idle

frequ

ency

ban

dstime

FDM cable

Channel partitioning MAC protocols FDMA

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

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

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

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

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

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

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

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

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

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

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

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

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

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

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

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

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

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

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

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

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

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

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

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

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

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

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

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

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

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

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

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

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

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

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

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

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

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

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

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

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

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

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

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

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

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

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

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

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

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

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

MAC (LAN) addresses

EC441 Ch6 - 52

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

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

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

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

57

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 destination

address frame contains A-to-B IP datagram

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

58

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

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 6: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 6

flow control bull pacing between adjacent sending and receiving nodes

error detection bull errors caused by signal attenuation noise bull receiver detects presence of errors signals sender for retransmission or drops frame

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

retransmission half-duplex and full-duplex

bull with half duplex nodes at both ends of link can transmit but not at same time

Link layer services (more)

EC441 Ch6 - 7

in each and every host link layer implemented in

ldquoadaptorrdquo (aka network interface card NIC) or on a chipbull Ethernet card 80211

card Ethernet chipsetbull implements link physical

layer attaches into hostrsquos system

buses combination of hardware

software firmware

controller

physical transmission

cpu memory

host bus (eg PCI)

network adapter card

application transport network

link

link physical

Where is the link layer implemented

EC441 Ch6 - 8

sending sidebull encapsulates datagram

in framebull adds error checking

bits rdt flow control etc

receiving sidebull looks for errors rdt flow

control etcbull extracts datagram passes to

upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

Adaptors communicating

EC441 Ch6 - 9

two types of ldquolinksrdquo point-to-point

bull PPP for dial-up accessbull point-to-point link between Ethernet switch host

broadcast (shared wire or medium)bull old-fashioned Ethernetbull upstream HFCbull 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF (satellite)

humans at a cocktail party

(shared air acoustical)

Multiple access links protocols

EC441 Ch6 - 10

single shared broadcast channel two or more simultaneous transmissions by nodes

interference bull collision if node receives two or more signals at the

same time

multiple access protocol distributed algorithm that determines how nodes share

channel ie determine when node can transmit communication about channel sharing must use channel

itself bull no out-of-band channel for coordination

Multiple access protocols

EC441 Ch6 - 11

given broadcast channel of rate R bps

goals1 when one node wants to transmit it can send at rate R2 when M nodes want to transmit each can send at average

rate RM3 fully decentralized no special node to coordinate transmissions no synchronization of clocks slots

4 simple

An ideal multiple access protocol

EC441 Ch6 - 12

three broad classes channel partitioning

bull divide channel into smaller ldquopiecesrdquo (time slots frequency code)bull allocate piece to node for exclusive use

random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

MAC protocols taxonomy

EC441 Ch6 - 13

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = packet transmission

time) in each round unused slots go idle example 6-station LAN 134 have packets to send slots 256

idle

1 3 4 1 3 4

6-slot frame

6-slot frame

Channel partitioning MAC protocols TDMA

EC441 Ch6 - 14

FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example 6-station LAN 134 have packet to send

frequency bands 256 idle

frequ

ency

ban

dstime

FDM cable

Channel partitioning MAC protocols FDMA

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

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

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

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

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

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

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

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

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

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

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

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

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

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

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

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

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

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

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

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

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

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

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

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

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

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

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

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

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

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

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

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

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

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

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

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

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

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

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

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

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

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

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

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

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

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

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

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

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

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

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

MAC (LAN) addresses

EC441 Ch6 - 52

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

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

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

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

57

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 destination

address frame contains A-to-B IP datagram

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

58

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

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 7: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 7

in each and every host link layer implemented in

ldquoadaptorrdquo (aka network interface card NIC) or on a chipbull Ethernet card 80211

card Ethernet chipsetbull implements link physical

layer attaches into hostrsquos system

buses combination of hardware

software firmware

controller

physical transmission

cpu memory

host bus (eg PCI)

network adapter card

application transport network

link

link physical

Where is the link layer implemented

EC441 Ch6 - 8

sending sidebull encapsulates datagram

in framebull adds error checking

bits rdt flow control etc

receiving sidebull looks for errors rdt flow

control etcbull extracts datagram passes to

upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

Adaptors communicating

EC441 Ch6 - 9

two types of ldquolinksrdquo point-to-point

bull PPP for dial-up accessbull point-to-point link between Ethernet switch host

broadcast (shared wire or medium)bull old-fashioned Ethernetbull upstream HFCbull 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF (satellite)

humans at a cocktail party

(shared air acoustical)

Multiple access links protocols

EC441 Ch6 - 10

single shared broadcast channel two or more simultaneous transmissions by nodes

interference bull collision if node receives two or more signals at the

same time

multiple access protocol distributed algorithm that determines how nodes share

channel ie determine when node can transmit communication about channel sharing must use channel

itself bull no out-of-band channel for coordination

Multiple access protocols

EC441 Ch6 - 11

given broadcast channel of rate R bps

goals1 when one node wants to transmit it can send at rate R2 when M nodes want to transmit each can send at average

rate RM3 fully decentralized no special node to coordinate transmissions no synchronization of clocks slots

4 simple

An ideal multiple access protocol

EC441 Ch6 - 12

three broad classes channel partitioning

bull divide channel into smaller ldquopiecesrdquo (time slots frequency code)bull allocate piece to node for exclusive use

random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

MAC protocols taxonomy

EC441 Ch6 - 13

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = packet transmission

time) in each round unused slots go idle example 6-station LAN 134 have packets to send slots 256

idle

1 3 4 1 3 4

6-slot frame

6-slot frame

Channel partitioning MAC protocols TDMA

EC441 Ch6 - 14

FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example 6-station LAN 134 have packet to send

frequency bands 256 idle

frequ

ency

ban

dstime

FDM cable

Channel partitioning MAC protocols FDMA

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

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

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

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

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

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

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

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

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

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

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

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

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

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

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

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

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

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

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

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

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

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

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

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

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

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

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

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

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

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

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

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

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

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

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

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

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

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

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

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

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

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

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

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

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

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

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

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

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

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

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

MAC (LAN) addresses

EC441 Ch6 - 52

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

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

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

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

57

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 destination

address frame contains A-to-B IP datagram

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

58

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

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 8: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 8

sending sidebull encapsulates datagram

in framebull adds error checking

bits rdt flow control etc

receiving sidebull looks for errors rdt flow

control etcbull extracts datagram passes to

upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

Adaptors communicating

EC441 Ch6 - 9

two types of ldquolinksrdquo point-to-point

bull PPP for dial-up accessbull point-to-point link between Ethernet switch host

broadcast (shared wire or medium)bull old-fashioned Ethernetbull upstream HFCbull 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF (satellite)

humans at a cocktail party

(shared air acoustical)

Multiple access links protocols

EC441 Ch6 - 10

single shared broadcast channel two or more simultaneous transmissions by nodes

interference bull collision if node receives two or more signals at the

same time

multiple access protocol distributed algorithm that determines how nodes share

channel ie determine when node can transmit communication about channel sharing must use channel

itself bull no out-of-band channel for coordination

Multiple access protocols

EC441 Ch6 - 11

given broadcast channel of rate R bps

goals1 when one node wants to transmit it can send at rate R2 when M nodes want to transmit each can send at average

rate RM3 fully decentralized no special node to coordinate transmissions no synchronization of clocks slots

4 simple

An ideal multiple access protocol

EC441 Ch6 - 12

three broad classes channel partitioning

bull divide channel into smaller ldquopiecesrdquo (time slots frequency code)bull allocate piece to node for exclusive use

random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

MAC protocols taxonomy

EC441 Ch6 - 13

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = packet transmission

time) in each round unused slots go idle example 6-station LAN 134 have packets to send slots 256

idle

1 3 4 1 3 4

6-slot frame

6-slot frame

Channel partitioning MAC protocols TDMA

EC441 Ch6 - 14

FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example 6-station LAN 134 have packet to send

frequency bands 256 idle

frequ

ency

ban

dstime

FDM cable

Channel partitioning MAC protocols FDMA

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

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

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

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

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

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

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

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

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

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

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

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

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

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

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

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

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

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

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

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

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

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

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

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

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

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

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

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

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

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

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

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

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

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

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

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

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

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

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

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

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

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

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

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

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

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

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

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

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

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

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

MAC (LAN) addresses

EC441 Ch6 - 52

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

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

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

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

57

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 destination

address frame contains A-to-B IP datagram

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

58

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

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 9: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 9

two types of ldquolinksrdquo point-to-point

bull PPP for dial-up accessbull point-to-point link between Ethernet switch host

broadcast (shared wire or medium)bull old-fashioned Ethernetbull upstream HFCbull 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF (satellite)

humans at a cocktail party

(shared air acoustical)

Multiple access links protocols

EC441 Ch6 - 10

single shared broadcast channel two or more simultaneous transmissions by nodes

interference bull collision if node receives two or more signals at the

same time

multiple access protocol distributed algorithm that determines how nodes share

channel ie determine when node can transmit communication about channel sharing must use channel

itself bull no out-of-band channel for coordination

Multiple access protocols

EC441 Ch6 - 11

given broadcast channel of rate R bps

goals1 when one node wants to transmit it can send at rate R2 when M nodes want to transmit each can send at average

rate RM3 fully decentralized no special node to coordinate transmissions no synchronization of clocks slots

4 simple

An ideal multiple access protocol

EC441 Ch6 - 12

three broad classes channel partitioning

bull divide channel into smaller ldquopiecesrdquo (time slots frequency code)bull allocate piece to node for exclusive use

random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

MAC protocols taxonomy

EC441 Ch6 - 13

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = packet transmission

time) in each round unused slots go idle example 6-station LAN 134 have packets to send slots 256

idle

1 3 4 1 3 4

6-slot frame

6-slot frame

Channel partitioning MAC protocols TDMA

EC441 Ch6 - 14

FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example 6-station LAN 134 have packet to send

frequency bands 256 idle

frequ

ency

ban

dstime

FDM cable

Channel partitioning MAC protocols FDMA

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

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

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

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

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

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

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

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

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

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

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

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

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

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

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

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

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

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

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

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

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

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

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

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

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

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

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

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

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

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

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

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

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

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

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

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

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

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

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

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

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

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

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

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

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

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

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

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

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

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

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

MAC (LAN) addresses

EC441 Ch6 - 52

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

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

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

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

57

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 destination

address frame contains A-to-B IP datagram

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

58

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

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 10: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 10

single shared broadcast channel two or more simultaneous transmissions by nodes

interference bull collision if node receives two or more signals at the

same time

multiple access protocol distributed algorithm that determines how nodes share

channel ie determine when node can transmit communication about channel sharing must use channel

itself bull no out-of-band channel for coordination

Multiple access protocols

EC441 Ch6 - 11

given broadcast channel of rate R bps

goals1 when one node wants to transmit it can send at rate R2 when M nodes want to transmit each can send at average

rate RM3 fully decentralized no special node to coordinate transmissions no synchronization of clocks slots

4 simple

An ideal multiple access protocol

EC441 Ch6 - 12

three broad classes channel partitioning

bull divide channel into smaller ldquopiecesrdquo (time slots frequency code)bull allocate piece to node for exclusive use

random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

MAC protocols taxonomy

EC441 Ch6 - 13

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = packet transmission

time) in each round unused slots go idle example 6-station LAN 134 have packets to send slots 256

idle

1 3 4 1 3 4

6-slot frame

6-slot frame

Channel partitioning MAC protocols TDMA

EC441 Ch6 - 14

FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example 6-station LAN 134 have packet to send

frequency bands 256 idle

frequ

ency

ban

dstime

FDM cable

Channel partitioning MAC protocols FDMA

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

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

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

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

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

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

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

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

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

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

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

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

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

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

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

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

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

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

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

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

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

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

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

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

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

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

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

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

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

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

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

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

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

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

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

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

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

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

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

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

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

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

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

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

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

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

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

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

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

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

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

MAC (LAN) addresses

EC441 Ch6 - 52

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

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

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

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

57

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 destination

address frame contains A-to-B IP datagram

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

58

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

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 11: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 11

given broadcast channel of rate R bps

goals1 when one node wants to transmit it can send at rate R2 when M nodes want to transmit each can send at average

rate RM3 fully decentralized no special node to coordinate transmissions no synchronization of clocks slots

4 simple

An ideal multiple access protocol

EC441 Ch6 - 12

three broad classes channel partitioning

bull divide channel into smaller ldquopiecesrdquo (time slots frequency code)bull allocate piece to node for exclusive use

random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

MAC protocols taxonomy

EC441 Ch6 - 13

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = packet transmission

time) in each round unused slots go idle example 6-station LAN 134 have packets to send slots 256

idle

1 3 4 1 3 4

6-slot frame

6-slot frame

Channel partitioning MAC protocols TDMA

EC441 Ch6 - 14

FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example 6-station LAN 134 have packet to send

frequency bands 256 idle

frequ

ency

ban

dstime

FDM cable

Channel partitioning MAC protocols FDMA

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

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

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

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

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

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

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

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

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

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

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

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

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

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

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

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

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

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

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

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

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

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

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

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

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

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

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

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

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

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

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

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

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

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

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

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

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

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

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

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

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

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

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

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

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

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

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

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

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

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

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

MAC (LAN) addresses

EC441 Ch6 - 52

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

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

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

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

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

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

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

57

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 destination

address frame contains A-to-B IP datagram

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

58

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

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

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

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

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

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

111111111112

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

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

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

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 12: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 12

three broad classes channel partitioning

bull divide channel into smaller ldquopiecesrdquo (time slots frequency code)bull allocate piece to node for exclusive use

random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

MAC protocols taxonomy

EC441 Ch6 - 13

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = packet transmission

time) in each round unused slots go idle example 6-station LAN 134 have packets to send slots 256

idle

1 3 4 1 3 4

6-slot frame

6-slot frame

Channel partitioning MAC protocols TDMA

EC441 Ch6 - 14

FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example 6-station LAN 134 have packet to send

frequency bands 256 idle

frequ

ency

ban

dstime

FDM cable

Channel partitioning MAC protocols FDMA

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

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

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

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

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

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

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

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

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

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

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

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

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

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

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

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

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

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

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

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

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 13: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 13

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = packet transmission

time) in each round unused slots go idle example 6-station LAN 134 have packets to send slots 256

idle

1 3 4 1 3 4

6-slot frame

6-slot frame

Channel partitioning MAC protocols TDMA

EC441 Ch6 - 14

FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example 6-station LAN 134 have packet to send

frequency bands 256 idle

frequ

ency

ban

dstime

FDM cable

Channel partitioning MAC protocols FDMA

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

bull if collision node retransmits frame in each subsequent slot with prob p until success

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

bull frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

collisions can still occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

bull difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 bull as tprop goes to 0bull as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 14: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 14

FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example 6-station LAN 134 have packet to send

frequency bands 256 idle

frequ

ency

ban

dstime

FDM cable

Channel partitioning MAC protocols FDMA

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

bull if collision node retransmits frame in each subsequent slot with prob p until success

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

bull frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

collisions can still occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

bull difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 bull as tprop goes to 0bull as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 15: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 15

when node has packet to sendbull transmit at full channel data rate Rbull no a priori coordination among nodes

two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies

bull how to detect collisionsbull how to recover from collisions (eg via delayed

retransmissions) examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

Random access protocols

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

bull if collision node retransmits frame in each subsequent slot with prob p until success

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

bull frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

collisions can still occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

bull difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 bull as tprop goes to 0bull as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 16: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 16

assumptions 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 slotbull if no collision node can

send new frame in next slot

bull if collision node retransmits frame in each subsequent slot with prob p until success

Slotted ALOHA

EC441 Ch6 - 17

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

EC441 Ch6 - 18

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

bull frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

collisions can still occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

bull difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 bull as tprop goes to 0bull as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 17: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 17

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

EC441 Ch6 - 18

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

bull frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

collisions can still occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

bull difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 bull as tprop goes to 0bull as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 18: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 18

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1 as N goes to infinity gives

max efficiency = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channel used for useful transmissions 37 of time

Slotted ALOHA efficiency

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

bull frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

collisions can still occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

bull difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 bull as tprop goes to 0bull as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 19: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 19

unslotted Aloha simpler no synchronization when frame first arrives

bull transmit immediately collision probability increases

bull frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure (unslotted) ALOHA

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

collisions can still occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

bull difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 bull as tprop goes to 0bull as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 20: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 20

P(success by given node) = P(node transmits) P(no other node tx in [t0-1t0]) P(no other node tx in [t0t0+1]) = p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n

= 1(2e) = 18

even worse than slotted Aloha

Pure ALOHA efficiency

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

collisions can still occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

bull difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 bull as tprop goes to 0bull as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 21: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 21

CSMA listen before transmitif channel sensed idle transmit entire frame if channel sensed busy defer transmission

human analogy donrsquot interrupt others

CSMA (carrier sense multiple access)

EC441 Ch6 - 22

collisions can still occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

bull difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 bull as tprop goes to 0bull as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 22: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 22

collisions can still occur propagation delay means two nodes may not hear each otherrsquos transmission

collision entire packet transmission time wastedbull distance amp

propagation delay play role in determining collision probability

CSMA collisions spatial layout of nodes

22

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

bull difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 bull as tprop goes to 0bull as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 23: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 23

CSMACD carrier sensing deferral as in CSMAbull collisions detected within short timebull colliding transmissions aborted reducing channel

wastage collision detection

bull easy in wired LANs measure signal strengths compare transmitted received signals

bull difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

CSMACD (collision detection)

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 bull as tprop goes to 0bull as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 24: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 24

CSMACD (collision detection)

EC441 Ch6 - 25

tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 bull as tprop goes to 0bull as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 25: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 25

tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

efficiency goes to 1 bull as tprop goes to 0bull as ttrans goes to infinity

better performance than ALOHA and simple cheap decentralized

transprop ttefficiency

511

+=

CSMACD efficiency

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 26: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 26

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access 1N

bandwidth allocated even if only 1 active node random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 27: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

token passing control token passed

from one node to next sequentially

token message concerns token overhead latency single point of failure

(token)

T

data

(nothing to send)

T

27

ldquoTaking turnsrdquo MAC protocols

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 28: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

cable headend

CMTS

ISP

cable modem termination 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

cable modemsplitter

hellip

hellip

Internet frames TV channels control transmitted downstream at different frequencies

upstream Internet frames TV control transmitted upstream at different frequencies in time slots

28

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 29: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

DOCSIS data over cable service interface spec FDM over upstream downstream frequency channels TDM upstream some slots assigned some have

contention bull downstream MAP frame assigns upstream slots bull request for upstream slots (and data) transmitted

random access (binary backoff) in selected slots

MAP frame for Interval [t1 t2]

Residences with cable modems

Downstream channel i

Upstream channel j

t1 t2

Assigned minislots containing cable modem upstream data frames

Minislots containing minislots request frames

cable headend

CMTS

Cable access network

29

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 30: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 30

channel partitioning by time frequency or codebull Time Division Frequency Division

random access (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire) hard

in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

taking turnsbull polling from central site token passingbull Bluetooth FDDI token ring

Summary of MAC protocols

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 31: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 31

ldquodominantrdquo wired LAN technology single chip multiple speeds (eg Broadcom BCM5761) first widely used LAN technology simpler cheap kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernet sketch

Ethernet

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 32: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 32

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 or wireless)

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 33: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 33

MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure

uniqueness) analogy

bull MAC address like Social Security Numberbull IP address like postal address

MAC flat address portability bull can move LAN card from one LAN to another

IP hierarchical address not portablebull address depends on IP subnet to which node is

attached

LAN addresses (more)

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 34: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 34

bus popular through mid 90sbull all nodes in same collision domain (can collide with

each other) star prevails today

bull active switch in centerbull each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

Ethernet physical topology

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 35: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 35

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble 7 bytes with pattern 10101010 followed by one byte with pattern

10101011 used to synchronize receiver sender clock rates

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 36: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 36

addresses 6 byte source destination MAC addressesbull if adapter receives frame with matching destination

address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

bull otherwise adapter discards frame type indicates higher layer protocol (mostly IP but others possible

eg Novell IPX AppleTalk) CRC cyclic redundancy check at receiver

bull error detected frame is dropped

dest address

source address

data (payload) CRCpreamble

type

Ethernet frame structure (more)

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 37: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 37

connectionless no handshaking between sending and receiving NICs

unreliable receiving NIC doesnt send acks or nacks to sending NICbull data in dropped frames recovered only if initial sender uses

higher layer rdt (eg TCP) otherwise dropped data lost Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

Ethernet unreliable connectionless

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 38: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 38

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters binary (exponential) backoff bull after mth collision NIC

chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2

bull longer backoff interval with more collisions

Ethernet CSMACD algorithm

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 39: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 39

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Ethernetrsquos CSMACD (more)

Exponential Backoff Goal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

first collision choose K from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 40: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 40

many different Ethernet standardsbull common MAC protocol and frame formatbull different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10 Gbps 40 Gbpsbull different physical layer media fiber cable

application transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twister pair) physical layer

8023 Ethernet standards link amp physical layers

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 41: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 41

link-layer device takes an active rolebull store forward Ethernet framesbull examine incoming framersquos MAC address selectively forward

frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentbull hosts are unaware of presence of switches

plug-and-play self-learningbull switches do not need to be configured

Ethernet switch

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 42: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 42

hosts have dedicated direct connection to switch

switches buffer packets Ethernet protocol used on

each incoming link but no collisions full duplexbull each link is its own collision

domain switching A-to-Arsquo and B-to-Brsquo

can transmit simultaneously without collisions switch with six interfaces

(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Switch multiple simultaneous transmissions

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 43: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 43

Q how does switch know Arsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces (123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6 A each switch has a switch table each entry (MAC address of host

interface to reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table something like a routing

protocol

Switch forwarding table

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 44: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

44

switch learns which hosts can be reached through which interfacesbull when frame received

switch ldquolearnsrdquo location of sender incoming LAN segment

bull records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

Switch self-learning

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 45: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 45

when frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 if entry found for destination

then if destination on segment from which frame arrived

then drop frame else forward frame on interface indicated by entry else flood forward on all interfaces except arriving interface

Switch frame filteringforwarding

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 46: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

46

frame destination Arsquo location unknown flood

Arsquo A

destination A location known

Arsquo 4 60

selectively send on just one link

Self-learning forwarding exampleA Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 47: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 47

self-learning switches can be connected together

Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3 A self learning (works exactly the same as in

single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Interconnecting switches

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 48: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 48

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Self-learning multi-switch example

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 49: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 49

Institutional network

to external network

router

IP subnet

mail server

web server

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 50: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 50

both are store-and-forward routers network-layer

devices (examine network-layer headers)

switches link-layer devices (examine link-layer headers)

both have forwarding tables routers compute tables

using routing algorithms IP

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

framedatagram

Switches vs routers

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 51: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 51

32-bit IP address bull network-layer address for interfacebull used for layer 3 (network layer) forwarding

MAC (or LAN or physical or Ethernet) address bull function used lsquolocallyrdquo to get frame from one interface

to another physically-connected interface (same network in IP-addressing sense)

bull 48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable

bull eg 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation (each ldquonumeralrdquo represents 4 bits)

MAC (LAN) addresses

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 52: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 52

ARP table each IP node (host router) on LAN has table

bull IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgtbull TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determine interfacersquos MAC address knowing its IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

ARP address resolution protocol

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 53: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 53

A wants to send datagram to Bbull Brsquos MAC address not in Arsquos ARP

table A broadcasts ARP query

packet containing Bs IP address bull destination MAC address = FF-

FF-FF-FF-FF-FFbull all nodes on LAN receive ARP

query B receives ARP packet

replies to A with its (Bs) MAC addressbull 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) bull soft state information that

times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquobull nodes create their ARP

tables without intervention from net administrator

ARP protocol same LAN

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 54: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 54

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

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 55: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

55

Addressing routing to another LAN

IP Eth Phy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address as destination

address frame contains A-to-B IP datagramMAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 56: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

56

Addressing routing to another LAN

IP Eth Phy

frame sent from A to R

IP Eth Phy

frame received at R datagram removed passed up to IP

MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B

IP src 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 57: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

57

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 destination

address frame contains A-to-B IP datagram

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 58: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

58

Addressing routing to another LAN R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as destination

address frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IP Eth Phy

IP Eth Phy

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 59: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

R

1A-23-F9-CD-06-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

59

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

IP Eth Phy

Check out the online interactive exercises for more examples httpgaiacsumassedukurose_rossinteractive

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 60: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 60

10rsquos to 100rsquos of thousands of hosts often closely coupled in close proximitybull e-business (eg Amazon)bull content-servers (eg YouTube Akamai Apple

Microsoft)bull search engines data mining (eg Google)

challenges multiple applications

each serving massive numbers of clients

managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

Data center networks

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 61: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

Load balancer

Load balancer

B

1 2 3 4 5 6 7 8

A C

Border router

Access router

Data center networks load balancer application-layer routing receives external client requests directs workload within data center returns results to external client (hiding

data center internals from client)

61

Internet

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 62: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

62

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 63: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -Link Layer and LANs 63

journey down protocol stack completebull application transport network link

putting-it-all-together synthesisbull goal identify review understand protocols (at all

layers) involved in seemingly simple scenario requesting www page

bull scenario student attaches laptop to campus network requestsreceives wwwgooglecom

Synthesis a day in the life of a web request

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 64: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 64

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 65: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

router (runs DHCP)

65

connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet

Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxed to IP demuxed UDP demuxed to DHCP

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 66: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

router (runs DHCP)

66

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 67: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

router (runs DHCP)

67

before sending HTTP request need IP address of wwwgooglecom DNS

DNS UDP

IP Eth Phy

DNS

DNS

DNS DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

Eth Phy

ARP

ARP

ARP reply

A day in the lifehellip ARP (before DNS before HTTP)

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 68: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

router (runs DHCP)

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into Comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server

demuxed to DNS server DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS server DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

68

A day in the lifehellip using DNS

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 69: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

router (runs DHCP)

69

A day in the lifehellipTCP connection carrying HTTP

HTTP TCP IP

Eth Phy

HTTP

to send HTTP request client first opens TCP socket to web server

TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCP IP

Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 70: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 -

router (runs DHCP)

70

A day in the lifehellip HTTP requestreply HTTP TCP IP

Eth Phy

HTTP

HTTP request sent into TCP socket

IP datagram containing HTTP request routed to wwwgooglecom

IP datagram containing HTTP reply routed back to client

64233169105web server

HTTP TCP IP

Eth Phy web server responds with

HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally () displayed

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary

Page 71: EC441 Spring 2020 Introduction to Computer Networking ...curl.bu.edu/static/content/ec441_spr2020/ec441_spr2020_ch6.pdf · Networking: A Top Down Approach” and is used with permission

EC441 Ch6 - 71

principles behind data link layer servicesbull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS

synthesis a day in the life of a web request

Chapter 6 Summary