10
1 Chapter 6: Link layer and LANs our goals: § understand principles behind link layer services: sharing a broadcast channel: multiple access link layer addressing local area networks: Ethernet, VLANs error detection, correction § instantiation, implementation of various link layer technologies 6-1 Link Layer and LANs 1 Link layer, LANs: outline 6.1 introduction, services 6.2 multiple access protocols 6.3 LANs addressing, ARP Ethernet switches VLANS 6.4 error detection, correction 6.5 data center networking 6.6 a day in the life of a web request 6-2 Link Layer and LANs 2 Link layer: introduction terminology: § hosts and routers: nodes § communication channels that connect adjacent nodes along communication path: links wired links wireless links 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 6-3 Link Layer and LANs 3 Link layer: context § datagram transferred by different link protocols over different links: e.g., Ethernet on first link, frame relay on intermediate links, 802.11 on last link § each link protocol provides different services e.g., may or may not provide rdt over link transportation analogy: § trip from Princeton to Lausanne limo: Princeton to JFK plane: JFK to Geneva train: Geneva to Lausanne § tourist = datagram § transport segment = communication link § transportation mode = link layer protocol § travel agent = routing algorithm 6-4 Link Layer and LANs 4 Link layer services § framing, link access: encapsulate datagram into frame, adding header, trailer channel access if shared medium MACaddresses used in frame headers to identify source, destination different from IP address! § reliable delivery between adjacent nodes we learned how to do this already (chapter 3)! seldom used on low bit-error link (fiber, some twisted pair) wireless links: high error rates Q: why both link-level and end-end reliability? 6-5 Link Layer and LANs 5 § flow control: pacing between adjacent sending and receiving nodes § error detection: errors caused by signal attenuation, noise. receiver detects presence of errors: signals sender for retransmission or drops frame § error correction: receiver identifies and corrects bit error(s) without resorting to retransmission § half-duplex and full-duplex with half duplex, nodes at both ends of link can transmit, but not at same time Link layer services (more) 6-6 Link Layer and LANs 6

Chapter 6: Link layer and LANs Link layer, LANs: outlineqyang/ele543/2020/Lecture7LAN.pdf · 2020-03-31 · §example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Chapter 6: Link layer and LANs Link layer, LANs: outlineqyang/ele543/2020/Lecture7LAN.pdf · 2020-03-31 · §example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle

1

Chapter 6 Link layer and LANsour goalssect understand principles behind link layer

servicesbull sharing a broadcast channel multiple accessbull link layer addressingbull local area networks Ethernet VLANsbull error detection correction

sect instantiation implementation of various link layer technologies

6-1Link Layer and LANs

1

Link layer LANs outline

61 introduction services62 multiple access

protocols63 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

64 error detection correction

65 data center networking

66 a day in the life of a web request

6-2Link Layer and LANs

2

Link layer introduction

terminologysect hosts and routers nodessect communication channels that

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

sect layer-2 packet frameencapsulates datagram

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

6-3Link Layer and LANs

3

Link layer context

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

frame relay on intermediate links 80211 on last link

sect each link protocol provides different servicesbull eg may or may not

provide rdt over link

transportation analogysect trip from Princeton to Lausanne

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

sect tourist = datagramsect transport segment =

communication linksect transportation mode = link

layer protocolsect travel agent = routing

algorithm

6-4Link Layer and LANs

4

Link layer servicessect 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 bull different from IP address

sect 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

bull Q why both link-level and end-end reliability

6-5Link Layer and LANs

5

sect flow controlbull pacing between adjacent sending and receiving nodes

sect error detection bull errors caused by signal attenuation noise bull receiver detects presence of errors

bull signals sender for retransmission or drops frame

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

retransmission

sect half-duplex and full-duplexbull with half duplex nodes at both ends of link can transmit but not

at same time

Link layer services (more)

6-6Link Layer and LANs

6

2

Where is the link layer implementedsect in each and every hostsect link layer implemented in ldquoadaptorrdquo (aka network interface card NIC) or on a chipbull Ethernet card 80211

card Ethernet chipsetbull implements link physical

layersect attaches into hostrsquos system

busessect combination of hardware

software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

6-7Link Layer and LANs

7

Adaptors communicating

sect sending sidebull encapsulates datagram in

framebull adds error checking bits

rdt flow control etc

sect 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

6-8Link Layer and LANs

8

Link layer LANs outline

61 introduction services62 multiple access

protocols63 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

64 error detection correction

65 data center networking

66 a day in the life of a web request

6-9Link Layer and LANs

9

Multiple access links protocolstwo types of ldquolinksrdquosect point-to-point

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

sect 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 acocktail party

(shared air acoustical)

6-10Link Layer and LANs

10

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

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

time

multiple access protocolsect distributed algorithm that determines how nodes share

channel ie determine when node can transmitsect communication about channel sharing must use channel itself

bull no out-of-band channel for coordination

6-11Link Layer and LANs

11

An ideal multiple access protocol

given broadcast channel of rate R bpsdesiderata

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

rate RM3 fully decentralized

bull no special node to coordinate transmissionsbull no synchronization of clocks slots

4 simple

6-12Link Layer and LANs

12

3

MAC protocols taxonomy

three broad classessect channel partitioning

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

sect random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

turns

6-13Link Layer and LANs

13

Channel partitioning MAC protocols TDMA

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

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

send slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

6-14Link Layer and LANs

14

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

bands 256 idle

frequ

ency

ban

ds

time

FDM cable

Channel partitioning MAC protocols FDMA

6-15Link Layer and LANs

15

Random access protocols

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

sect two or more transmitting nodes ldquocollisionrdquosect random access MAC protocol specifies

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

retransmissions)sect examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

6-16Link Layer and LANs

16

Slotted ALOHA

assumptionssect all frames same sizesect time divided into equal size

slots (time to transmit 1 frame)

sect nodes start to transmit only slot beginning

sect nodes are synchronizedsect if 2 or more nodes transmit

in slot all nodes detect collision

operationsect when node obtains fresh

frame transmits in next slotbull if no collision node can send

new frame in next slotbull if collision node retransmits

frame in each subsequent slot with prob p until success

6-17Link Layer and LANs

17

Prossect single active node can

continuously transmit at full rate of channel

sect highly decentralized only slots in nodes need to be in sync

sect simple

Conssect collisions wasting slotssect idle slotssect 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

6-18Link Layer and LANs

18

4

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

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

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

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

sect for many nodes take limit of Np(1-p)N-1 as N goes to infinity givesmax efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

6-19Link Layer and LANs

19

Pure (unslotted) ALOHA

sect unslotted Aloha simpler no synchronizationsect when frame first arrives

bull transmit immediately sect collision probability increases

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

6-20Link Layer and LANs

20

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

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

= 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

6-21Link Layer and LANs

21

CSMA (carrier sense multiple access)

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

transmission

sect human analogy donrsquot interrupt others

6-22Link Layer and LANs

22

CSMA collisions

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

sect collision entire packet transmission time wastedbull distance amp

propagation delay play role in in determining collision probability

spatial layout of nodes

6-23Link Layer and LANs

23

CSMACD (collision detection)

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

sect collision detectionbull easy in wired LANs measure signal strengths compare

transmitted received signalsbull difficult in wireless LANs received signal strength

overwhelmed by local transmission strength sect human analogy the polite conversationalist

6-24Link Layer and LANs

24

5

CSMACD (collision detection)

spatial layout of nodes

6-25Link Layer and LANs

25

Ethernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

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

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

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

5 After aborting NIC enters binary (exponential) backoff 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

6-26Link Layer and LANs

26

ldquoTaking turnsrdquo MAC protocols

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

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

sect efficient at low load single node can fully utilize channel

sect high load collision overheadldquotaking turnsrdquo protocols

look for best of both worlds

6-27Link Layer and LANs

27

pollingsect master node ldquoinvitesrdquo

slave nodes to transmit in turn

sect typically used with ldquodumbrdquo slave devices

sect concernsbull polling overhead bull latencybull single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

6-28Link Layer and LANs

28

token passingsect control token passed from

one node to next sequentially

sect token messagesect concerns

sect token overhead sect latencysect single point of failure

(token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

6-29Link Layer and LANs

29

Multiple Slotssect Flag at the beginning of a

slot indicating busyidlesect Transmit if idle and set

busysect If F busy try next slot

Delay Analysissect Let ring utilization be

U it is the probability that a slot is busy

S

data

(nothingto send)

S

ldquoSlotted Ringrdquo MAC protocols

6-30Link Layer and LANs

F

F

F

F

30

6

sect Suppose data packets arrives at the queue with rate 120582 following Poison Distribution

sect Ring utilization U

sect Slot length x in bits timesect Delay includes

1 Queue delay with queue length Q from the time the packet arrives until it reaches the head

2 Access delay d finding an empty slot after reaching queue head and filling the slot

S

data

(nothingto send)

S

ldquoSlotted Ringrdquo Performance Analysis

6-31Link Layer and LANs

F

F

F

F

AccessQueue

Flag IndicatingBusyidle slot

31

ldquoSlotted Ringrdquo Performance Analysis

6-32Link Layer and LANs

119941 = 119909119880 1 minus 119880 + 21199091198802(1 minus 119880)+3119909U3(1-U)+helliphellip=sum$

119894119909119880(1 minus 119880) = amp()

bull Upon arrival of a packet to the queue the packet has to wait for all packets before it in the queue to finish Therefore the wait time of the arrival packet is given by

W=1199092+d +Q(d+119909)bull FromLittlersquosLaw

Q=120582119882W=1199092+d +120582119882(d+119909)

bull SolvingforWwehave

W=

+119941

$(119941 )=

)G)+-+

HIJ()+-+

G K)

32

Summary of MAC protocols

sect channel partitioning by time frequency or codebull Time Division Frequency Division

sect 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

sect taking turnsbull polling from central site token passing slotted ringbull Bluetooth FDDI token ring Tornet

6-33Link Layer and LANs

33

Link layer LANs outline

61 introduction services62 multiple access

protocols63 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

64 error detection correction

65 data center networking

66 a day in the life of a web request

6-34Link Layer and LANs

34

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

Metcalfersquos Ethernet sketch

6-35Link Layer and LANs

35

Ethernet physical topologysect bus popular through mid 90s

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

sect star prevails todaybull active switch in center

bull each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

6-36Link Layer and LANs

36

7

Ethernet frame structure

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

preamble sect 7 bytes with pattern 10101010 followed by one

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

destaddress

sourceaddress

data (payload) CRCpreamble

type

6-37Link Layer and LANs

37

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

bull 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

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

sect CRC cyclic redundancy check at receiverbull error detected frame is dropped

destaddress source

address data (payload) CRCpreamble

type

6-38Link Layer and LANs

38

Ethernet unreliable connectionless

sect connectionless no handshaking between sending and receiving NICs

sect 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

sect Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

6-39Link Layer and LANs

39

8023 Ethernet standards link amp physical layers

sect 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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

6-40Link Layer and LANs

40

Switches vs routers

both are store-and-forward sect routers network-layer

devices (examine network-layer headers)

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

both have forwarding tablessect routers compute tables using

routing algorithms IP addresses

sect switches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frameframe

framedatagram

6-41Link Layer and LANs

41Network Layer 4-42

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

CollisionInterference

42

8

Network Layer 4-43

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

1 Each input node generates Connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a nodeWill try again in the next slot time with theSame probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

43Network Layer 4-44

1 Each input node generates connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a node will try again in the next slot time with the same probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

The prob that an input node tries to connect to an output node is pMThe prob that a request of an input node is not addressed to an output node is 1 - pMWhat is the probability that none of N input nodes requests for the output node

(1-pM)NWhat is the probability that at least one input node requests connection to that output node

1- (1-pM)N

How many connection in total can we have in a slot timeBW= M(1- (1-pM)N)

Assume Ngt=MHomework Use this same analytical technique to analyze an 120512minus 119951119942119957119960119952119955119948

44

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-45Link Layer and LANs

45

Data center networks

sect 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)

sect challengessect multiple applications each

serving massive numbers of clients

sect managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

6-46Link Layer and LANs

46

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 routingsect receives external client requestssect directs workload within data centersect returns results to external client (hiding data

center internals from client)

6-47Link Layer and LANs

Internet

47

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks sect rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

6-48Link Layer and LANs

48

9

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-49Link Layer and LANs

49

Synthesis a day in the life of a web request

sect journey down protocol stack completebull application transport network link

sect 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

6-50Link Layer and LANs

50

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

6-51Link Layer and LANs

51

router(runs DHCP)

A day in the lifehellip connecting to the Internet

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

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

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

sect Ethernet demuxed to IP demuxed UDP demuxed to DHCP

6-52Link Layer and LANs

52

router(runs DHCP)

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

sect 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

sect DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

6-53Link Layer and LANs

53

router(runs DHCP)

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

sect before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDPIPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

6-54Link Layer and LANs

54

10

router(runs DHCP)

DNSUDPIPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

sect demuxed to DNS serversect DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDPIPEthPhy

DNS

DNS

DNS

DNS

A day in the lifehellip using DNS

6-55Link Layer and LANs

55

router(runs DHCP)

A day in the lifehellipTCP connection carrying HTTP

HTTPTCPIPEthPhy

HTTP

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

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

sect TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIPEthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

6-56Link Layer and LANs

56

router(runs DHCP)

A day in the lifehellip HTTP requestreply HTTPTCPIPEthPhy

HTTP

sect HTTP request sent into TCP socket

sect IP datagram containing HTTP request routed to wwwgooglecom

sect IP datagram containing HTTP reply routed back to client

64233169105web server

HTTPTCPIPEthPhy

sect web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

sect web page finally () displayed

6-57Link Layer and LANs

57

Chapter 6 Summarysect principles behind data link layer services

bull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

sect instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS VLANsbull virtualized networks as a link layer MPLS

sect synthesis a day in the life of a web request

6-58Link Layer and LANs

58

Chapter 6 letrsquos take a breath

sect journey down protocol stack complete (except PHY)

sect solid understanding of networking principles practice

sect hellip could stop here hellip but lots of interesting topicsbull wirelessbull multimediabull security

6-59Link Layer and LANs

59

Page 2: Chapter 6: Link layer and LANs Link layer, LANs: outlineqyang/ele543/2020/Lecture7LAN.pdf · 2020-03-31 · §example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle

2

Where is the link layer implementedsect in each and every hostsect link layer implemented in ldquoadaptorrdquo (aka network interface card NIC) or on a chipbull Ethernet card 80211

card Ethernet chipsetbull implements link physical

layersect attaches into hostrsquos system

busessect combination of hardware

software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

applicationtransportnetwork

link

linkphysical

6-7Link Layer and LANs

7

Adaptors communicating

sect sending sidebull encapsulates datagram in

framebull adds error checking bits

rdt flow control etc

sect 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

6-8Link Layer and LANs

8

Link layer LANs outline

61 introduction services62 multiple access

protocols63 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

64 error detection correction

65 data center networking

66 a day in the life of a web request

6-9Link Layer and LANs

9

Multiple access links protocolstwo types of ldquolinksrdquosect point-to-point

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

sect 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 acocktail party

(shared air acoustical)

6-10Link Layer and LANs

10

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

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

time

multiple access protocolsect distributed algorithm that determines how nodes share

channel ie determine when node can transmitsect communication about channel sharing must use channel itself

bull no out-of-band channel for coordination

6-11Link Layer and LANs

11

An ideal multiple access protocol

given broadcast channel of rate R bpsdesiderata

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

rate RM3 fully decentralized

bull no special node to coordinate transmissionsbull no synchronization of clocks slots

4 simple

6-12Link Layer and LANs

12

3

MAC protocols taxonomy

three broad classessect channel partitioning

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

sect random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

turns

6-13Link Layer and LANs

13

Channel partitioning MAC protocols TDMA

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

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

send slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

6-14Link Layer and LANs

14

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

bands 256 idle

frequ

ency

ban

ds

time

FDM cable

Channel partitioning MAC protocols FDMA

6-15Link Layer and LANs

15

Random access protocols

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

sect two or more transmitting nodes ldquocollisionrdquosect random access MAC protocol specifies

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

retransmissions)sect examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

6-16Link Layer and LANs

16

Slotted ALOHA

assumptionssect all frames same sizesect time divided into equal size

slots (time to transmit 1 frame)

sect nodes start to transmit only slot beginning

sect nodes are synchronizedsect if 2 or more nodes transmit

in slot all nodes detect collision

operationsect when node obtains fresh

frame transmits in next slotbull if no collision node can send

new frame in next slotbull if collision node retransmits

frame in each subsequent slot with prob p until success

6-17Link Layer and LANs

17

Prossect single active node can

continuously transmit at full rate of channel

sect highly decentralized only slots in nodes need to be in sync

sect simple

Conssect collisions wasting slotssect idle slotssect 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

6-18Link Layer and LANs

18

4

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

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

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

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

sect for many nodes take limit of Np(1-p)N-1 as N goes to infinity givesmax efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

6-19Link Layer and LANs

19

Pure (unslotted) ALOHA

sect unslotted Aloha simpler no synchronizationsect when frame first arrives

bull transmit immediately sect collision probability increases

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

6-20Link Layer and LANs

20

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

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

= 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

6-21Link Layer and LANs

21

CSMA (carrier sense multiple access)

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

transmission

sect human analogy donrsquot interrupt others

6-22Link Layer and LANs

22

CSMA collisions

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

sect collision entire packet transmission time wastedbull distance amp

propagation delay play role in in determining collision probability

spatial layout of nodes

6-23Link Layer and LANs

23

CSMACD (collision detection)

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

sect collision detectionbull easy in wired LANs measure signal strengths compare

transmitted received signalsbull difficult in wireless LANs received signal strength

overwhelmed by local transmission strength sect human analogy the polite conversationalist

6-24Link Layer and LANs

24

5

CSMACD (collision detection)

spatial layout of nodes

6-25Link Layer and LANs

25

Ethernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

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

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

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

5 After aborting NIC enters binary (exponential) backoff 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

6-26Link Layer and LANs

26

ldquoTaking turnsrdquo MAC protocols

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

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

sect efficient at low load single node can fully utilize channel

sect high load collision overheadldquotaking turnsrdquo protocols

look for best of both worlds

6-27Link Layer and LANs

27

pollingsect master node ldquoinvitesrdquo

slave nodes to transmit in turn

sect typically used with ldquodumbrdquo slave devices

sect concernsbull polling overhead bull latencybull single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

6-28Link Layer and LANs

28

token passingsect control token passed from

one node to next sequentially

sect token messagesect concerns

sect token overhead sect latencysect single point of failure

(token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

6-29Link Layer and LANs

29

Multiple Slotssect Flag at the beginning of a

slot indicating busyidlesect Transmit if idle and set

busysect If F busy try next slot

Delay Analysissect Let ring utilization be

U it is the probability that a slot is busy

S

data

(nothingto send)

S

ldquoSlotted Ringrdquo MAC protocols

6-30Link Layer and LANs

F

F

F

F

30

6

sect Suppose data packets arrives at the queue with rate 120582 following Poison Distribution

sect Ring utilization U

sect Slot length x in bits timesect Delay includes

1 Queue delay with queue length Q from the time the packet arrives until it reaches the head

2 Access delay d finding an empty slot after reaching queue head and filling the slot

S

data

(nothingto send)

S

ldquoSlotted Ringrdquo Performance Analysis

6-31Link Layer and LANs

F

F

F

F

AccessQueue

Flag IndicatingBusyidle slot

31

ldquoSlotted Ringrdquo Performance Analysis

6-32Link Layer and LANs

119941 = 119909119880 1 minus 119880 + 21199091198802(1 minus 119880)+3119909U3(1-U)+helliphellip=sum$

119894119909119880(1 minus 119880) = amp()

bull Upon arrival of a packet to the queue the packet has to wait for all packets before it in the queue to finish Therefore the wait time of the arrival packet is given by

W=1199092+d +Q(d+119909)bull FromLittlersquosLaw

Q=120582119882W=1199092+d +120582119882(d+119909)

bull SolvingforWwehave

W=

+119941

$(119941 )=

)G)+-+

HIJ()+-+

G K)

32

Summary of MAC protocols

sect channel partitioning by time frequency or codebull Time Division Frequency Division

sect 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

sect taking turnsbull polling from central site token passing slotted ringbull Bluetooth FDDI token ring Tornet

6-33Link Layer and LANs

33

Link layer LANs outline

61 introduction services62 multiple access

protocols63 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

64 error detection correction

65 data center networking

66 a day in the life of a web request

6-34Link Layer and LANs

34

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

Metcalfersquos Ethernet sketch

6-35Link Layer and LANs

35

Ethernet physical topologysect bus popular through mid 90s

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

sect star prevails todaybull active switch in center

bull each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

6-36Link Layer and LANs

36

7

Ethernet frame structure

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

preamble sect 7 bytes with pattern 10101010 followed by one

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

destaddress

sourceaddress

data (payload) CRCpreamble

type

6-37Link Layer and LANs

37

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

bull 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

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

sect CRC cyclic redundancy check at receiverbull error detected frame is dropped

destaddress source

address data (payload) CRCpreamble

type

6-38Link Layer and LANs

38

Ethernet unreliable connectionless

sect connectionless no handshaking between sending and receiving NICs

sect 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

sect Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

6-39Link Layer and LANs

39

8023 Ethernet standards link amp physical layers

sect 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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

6-40Link Layer and LANs

40

Switches vs routers

both are store-and-forward sect routers network-layer

devices (examine network-layer headers)

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

both have forwarding tablessect routers compute tables using

routing algorithms IP addresses

sect switches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frameframe

framedatagram

6-41Link Layer and LANs

41Network Layer 4-42

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

CollisionInterference

42

8

Network Layer 4-43

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

1 Each input node generates Connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a nodeWill try again in the next slot time with theSame probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

43Network Layer 4-44

1 Each input node generates connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a node will try again in the next slot time with the same probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

The prob that an input node tries to connect to an output node is pMThe prob that a request of an input node is not addressed to an output node is 1 - pMWhat is the probability that none of N input nodes requests for the output node

(1-pM)NWhat is the probability that at least one input node requests connection to that output node

1- (1-pM)N

How many connection in total can we have in a slot timeBW= M(1- (1-pM)N)

Assume Ngt=MHomework Use this same analytical technique to analyze an 120512minus 119951119942119957119960119952119955119948

44

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-45Link Layer and LANs

45

Data center networks

sect 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)

sect challengessect multiple applications each

serving massive numbers of clients

sect managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

6-46Link Layer and LANs

46

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 routingsect receives external client requestssect directs workload within data centersect returns results to external client (hiding data

center internals from client)

6-47Link Layer and LANs

Internet

47

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks sect rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

6-48Link Layer and LANs

48

9

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-49Link Layer and LANs

49

Synthesis a day in the life of a web request

sect journey down protocol stack completebull application transport network link

sect 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

6-50Link Layer and LANs

50

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

6-51Link Layer and LANs

51

router(runs DHCP)

A day in the lifehellip connecting to the Internet

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

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

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

sect Ethernet demuxed to IP demuxed UDP demuxed to DHCP

6-52Link Layer and LANs

52

router(runs DHCP)

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

sect 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

sect DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

6-53Link Layer and LANs

53

router(runs DHCP)

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

sect before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDPIPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

6-54Link Layer and LANs

54

10

router(runs DHCP)

DNSUDPIPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

sect demuxed to DNS serversect DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDPIPEthPhy

DNS

DNS

DNS

DNS

A day in the lifehellip using DNS

6-55Link Layer and LANs

55

router(runs DHCP)

A day in the lifehellipTCP connection carrying HTTP

HTTPTCPIPEthPhy

HTTP

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

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

sect TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIPEthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

6-56Link Layer and LANs

56

router(runs DHCP)

A day in the lifehellip HTTP requestreply HTTPTCPIPEthPhy

HTTP

sect HTTP request sent into TCP socket

sect IP datagram containing HTTP request routed to wwwgooglecom

sect IP datagram containing HTTP reply routed back to client

64233169105web server

HTTPTCPIPEthPhy

sect web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

sect web page finally () displayed

6-57Link Layer and LANs

57

Chapter 6 Summarysect principles behind data link layer services

bull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

sect instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS VLANsbull virtualized networks as a link layer MPLS

sect synthesis a day in the life of a web request

6-58Link Layer and LANs

58

Chapter 6 letrsquos take a breath

sect journey down protocol stack complete (except PHY)

sect solid understanding of networking principles practice

sect hellip could stop here hellip but lots of interesting topicsbull wirelessbull multimediabull security

6-59Link Layer and LANs

59

Page 3: Chapter 6: Link layer and LANs Link layer, LANs: outlineqyang/ele543/2020/Lecture7LAN.pdf · 2020-03-31 · §example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle

3

MAC protocols taxonomy

three broad classessect channel partitioning

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

sect random accessbull channel not divided allow collisionsbull ldquorecoverrdquo from collisions

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

turns

6-13Link Layer and LANs

13

Channel partitioning MAC protocols TDMA

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

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

send slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

6-14Link Layer and LANs

14

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

bands 256 idle

frequ

ency

ban

ds

time

FDM cable

Channel partitioning MAC protocols FDMA

6-15Link Layer and LANs

15

Random access protocols

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

sect two or more transmitting nodes ldquocollisionrdquosect random access MAC protocol specifies

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

retransmissions)sect examples of random access MAC protocols

bull slotted ALOHAbull ALOHAbull CSMA CSMACD CSMACA

6-16Link Layer and LANs

16

Slotted ALOHA

assumptionssect all frames same sizesect time divided into equal size

slots (time to transmit 1 frame)

sect nodes start to transmit only slot beginning

sect nodes are synchronizedsect if 2 or more nodes transmit

in slot all nodes detect collision

operationsect when node obtains fresh

frame transmits in next slotbull if no collision node can send

new frame in next slotbull if collision node retransmits

frame in each subsequent slot with prob p until success

6-17Link Layer and LANs

17

Prossect single active node can

continuously transmit at full rate of channel

sect highly decentralized only slots in nodes need to be in sync

sect simple

Conssect collisions wasting slotssect idle slotssect 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

6-18Link Layer and LANs

18

4

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

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

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

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

sect for many nodes take limit of Np(1-p)N-1 as N goes to infinity givesmax efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

6-19Link Layer and LANs

19

Pure (unslotted) ALOHA

sect unslotted Aloha simpler no synchronizationsect when frame first arrives

bull transmit immediately sect collision probability increases

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

6-20Link Layer and LANs

20

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

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

= 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

6-21Link Layer and LANs

21

CSMA (carrier sense multiple access)

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

transmission

sect human analogy donrsquot interrupt others

6-22Link Layer and LANs

22

CSMA collisions

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

sect collision entire packet transmission time wastedbull distance amp

propagation delay play role in in determining collision probability

spatial layout of nodes

6-23Link Layer and LANs

23

CSMACD (collision detection)

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

sect collision detectionbull easy in wired LANs measure signal strengths compare

transmitted received signalsbull difficult in wireless LANs received signal strength

overwhelmed by local transmission strength sect human analogy the polite conversationalist

6-24Link Layer and LANs

24

5

CSMACD (collision detection)

spatial layout of nodes

6-25Link Layer and LANs

25

Ethernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

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

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

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

5 After aborting NIC enters binary (exponential) backoff 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

6-26Link Layer and LANs

26

ldquoTaking turnsrdquo MAC protocols

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

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

sect efficient at low load single node can fully utilize channel

sect high load collision overheadldquotaking turnsrdquo protocols

look for best of both worlds

6-27Link Layer and LANs

27

pollingsect master node ldquoinvitesrdquo

slave nodes to transmit in turn

sect typically used with ldquodumbrdquo slave devices

sect concernsbull polling overhead bull latencybull single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

6-28Link Layer and LANs

28

token passingsect control token passed from

one node to next sequentially

sect token messagesect concerns

sect token overhead sect latencysect single point of failure

(token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

6-29Link Layer and LANs

29

Multiple Slotssect Flag at the beginning of a

slot indicating busyidlesect Transmit if idle and set

busysect If F busy try next slot

Delay Analysissect Let ring utilization be

U it is the probability that a slot is busy

S

data

(nothingto send)

S

ldquoSlotted Ringrdquo MAC protocols

6-30Link Layer and LANs

F

F

F

F

30

6

sect Suppose data packets arrives at the queue with rate 120582 following Poison Distribution

sect Ring utilization U

sect Slot length x in bits timesect Delay includes

1 Queue delay with queue length Q from the time the packet arrives until it reaches the head

2 Access delay d finding an empty slot after reaching queue head and filling the slot

S

data

(nothingto send)

S

ldquoSlotted Ringrdquo Performance Analysis

6-31Link Layer and LANs

F

F

F

F

AccessQueue

Flag IndicatingBusyidle slot

31

ldquoSlotted Ringrdquo Performance Analysis

6-32Link Layer and LANs

119941 = 119909119880 1 minus 119880 + 21199091198802(1 minus 119880)+3119909U3(1-U)+helliphellip=sum$

119894119909119880(1 minus 119880) = amp()

bull Upon arrival of a packet to the queue the packet has to wait for all packets before it in the queue to finish Therefore the wait time of the arrival packet is given by

W=1199092+d +Q(d+119909)bull FromLittlersquosLaw

Q=120582119882W=1199092+d +120582119882(d+119909)

bull SolvingforWwehave

W=

+119941

$(119941 )=

)G)+-+

HIJ()+-+

G K)

32

Summary of MAC protocols

sect channel partitioning by time frequency or codebull Time Division Frequency Division

sect 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

sect taking turnsbull polling from central site token passing slotted ringbull Bluetooth FDDI token ring Tornet

6-33Link Layer and LANs

33

Link layer LANs outline

61 introduction services62 multiple access

protocols63 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

64 error detection correction

65 data center networking

66 a day in the life of a web request

6-34Link Layer and LANs

34

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

Metcalfersquos Ethernet sketch

6-35Link Layer and LANs

35

Ethernet physical topologysect bus popular through mid 90s

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

sect star prevails todaybull active switch in center

bull each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

6-36Link Layer and LANs

36

7

Ethernet frame structure

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

preamble sect 7 bytes with pattern 10101010 followed by one

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

destaddress

sourceaddress

data (payload) CRCpreamble

type

6-37Link Layer and LANs

37

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

bull 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

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

sect CRC cyclic redundancy check at receiverbull error detected frame is dropped

destaddress source

address data (payload) CRCpreamble

type

6-38Link Layer and LANs

38

Ethernet unreliable connectionless

sect connectionless no handshaking between sending and receiving NICs

sect 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

sect Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

6-39Link Layer and LANs

39

8023 Ethernet standards link amp physical layers

sect 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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

6-40Link Layer and LANs

40

Switches vs routers

both are store-and-forward sect routers network-layer

devices (examine network-layer headers)

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

both have forwarding tablessect routers compute tables using

routing algorithms IP addresses

sect switches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frameframe

framedatagram

6-41Link Layer and LANs

41Network Layer 4-42

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

CollisionInterference

42

8

Network Layer 4-43

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

1 Each input node generates Connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a nodeWill try again in the next slot time with theSame probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

43Network Layer 4-44

1 Each input node generates connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a node will try again in the next slot time with the same probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

The prob that an input node tries to connect to an output node is pMThe prob that a request of an input node is not addressed to an output node is 1 - pMWhat is the probability that none of N input nodes requests for the output node

(1-pM)NWhat is the probability that at least one input node requests connection to that output node

1- (1-pM)N

How many connection in total can we have in a slot timeBW= M(1- (1-pM)N)

Assume Ngt=MHomework Use this same analytical technique to analyze an 120512minus 119951119942119957119960119952119955119948

44

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-45Link Layer and LANs

45

Data center networks

sect 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)

sect challengessect multiple applications each

serving massive numbers of clients

sect managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

6-46Link Layer and LANs

46

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 routingsect receives external client requestssect directs workload within data centersect returns results to external client (hiding data

center internals from client)

6-47Link Layer and LANs

Internet

47

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks sect rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

6-48Link Layer and LANs

48

9

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-49Link Layer and LANs

49

Synthesis a day in the life of a web request

sect journey down protocol stack completebull application transport network link

sect 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

6-50Link Layer and LANs

50

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

6-51Link Layer and LANs

51

router(runs DHCP)

A day in the lifehellip connecting to the Internet

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

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

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

sect Ethernet demuxed to IP demuxed UDP demuxed to DHCP

6-52Link Layer and LANs

52

router(runs DHCP)

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

sect 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

sect DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

6-53Link Layer and LANs

53

router(runs DHCP)

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

sect before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDPIPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

6-54Link Layer and LANs

54

10

router(runs DHCP)

DNSUDPIPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

sect demuxed to DNS serversect DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDPIPEthPhy

DNS

DNS

DNS

DNS

A day in the lifehellip using DNS

6-55Link Layer and LANs

55

router(runs DHCP)

A day in the lifehellipTCP connection carrying HTTP

HTTPTCPIPEthPhy

HTTP

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

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

sect TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIPEthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

6-56Link Layer and LANs

56

router(runs DHCP)

A day in the lifehellip HTTP requestreply HTTPTCPIPEthPhy

HTTP

sect HTTP request sent into TCP socket

sect IP datagram containing HTTP request routed to wwwgooglecom

sect IP datagram containing HTTP reply routed back to client

64233169105web server

HTTPTCPIPEthPhy

sect web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

sect web page finally () displayed

6-57Link Layer and LANs

57

Chapter 6 Summarysect principles behind data link layer services

bull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

sect instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS VLANsbull virtualized networks as a link layer MPLS

sect synthesis a day in the life of a web request

6-58Link Layer and LANs

58

Chapter 6 letrsquos take a breath

sect journey down protocol stack complete (except PHY)

sect solid understanding of networking principles practice

sect hellip could stop here hellip but lots of interesting topicsbull wirelessbull multimediabull security

6-59Link Layer and LANs

59

Page 4: Chapter 6: Link layer and LANs Link layer, LANs: outlineqyang/ele543/2020/Lecture7LAN.pdf · 2020-03-31 · §example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle

4

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

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

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

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

sect for many nodes take limit of Np(1-p)N-1 as N goes to infinity givesmax efficiency = 1e = 37

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

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

6-19Link Layer and LANs

19

Pure (unslotted) ALOHA

sect unslotted Aloha simpler no synchronizationsect when frame first arrives

bull transmit immediately sect collision probability increases

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

6-20Link Layer and LANs

20

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

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

= 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

6-21Link Layer and LANs

21

CSMA (carrier sense multiple access)

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

transmission

sect human analogy donrsquot interrupt others

6-22Link Layer and LANs

22

CSMA collisions

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

sect collision entire packet transmission time wastedbull distance amp

propagation delay play role in in determining collision probability

spatial layout of nodes

6-23Link Layer and LANs

23

CSMACD (collision detection)

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

sect collision detectionbull easy in wired LANs measure signal strengths compare

transmitted received signalsbull difficult in wireless LANs received signal strength

overwhelmed by local transmission strength sect human analogy the polite conversationalist

6-24Link Layer and LANs

24

5

CSMACD (collision detection)

spatial layout of nodes

6-25Link Layer and LANs

25

Ethernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

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

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

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

5 After aborting NIC enters binary (exponential) backoff 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

6-26Link Layer and LANs

26

ldquoTaking turnsrdquo MAC protocols

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

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

sect efficient at low load single node can fully utilize channel

sect high load collision overheadldquotaking turnsrdquo protocols

look for best of both worlds

6-27Link Layer and LANs

27

pollingsect master node ldquoinvitesrdquo

slave nodes to transmit in turn

sect typically used with ldquodumbrdquo slave devices

sect concernsbull polling overhead bull latencybull single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

6-28Link Layer and LANs

28

token passingsect control token passed from

one node to next sequentially

sect token messagesect concerns

sect token overhead sect latencysect single point of failure

(token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

6-29Link Layer and LANs

29

Multiple Slotssect Flag at the beginning of a

slot indicating busyidlesect Transmit if idle and set

busysect If F busy try next slot

Delay Analysissect Let ring utilization be

U it is the probability that a slot is busy

S

data

(nothingto send)

S

ldquoSlotted Ringrdquo MAC protocols

6-30Link Layer and LANs

F

F

F

F

30

6

sect Suppose data packets arrives at the queue with rate 120582 following Poison Distribution

sect Ring utilization U

sect Slot length x in bits timesect Delay includes

1 Queue delay with queue length Q from the time the packet arrives until it reaches the head

2 Access delay d finding an empty slot after reaching queue head and filling the slot

S

data

(nothingto send)

S

ldquoSlotted Ringrdquo Performance Analysis

6-31Link Layer and LANs

F

F

F

F

AccessQueue

Flag IndicatingBusyidle slot

31

ldquoSlotted Ringrdquo Performance Analysis

6-32Link Layer and LANs

119941 = 119909119880 1 minus 119880 + 21199091198802(1 minus 119880)+3119909U3(1-U)+helliphellip=sum$

119894119909119880(1 minus 119880) = amp()

bull Upon arrival of a packet to the queue the packet has to wait for all packets before it in the queue to finish Therefore the wait time of the arrival packet is given by

W=1199092+d +Q(d+119909)bull FromLittlersquosLaw

Q=120582119882W=1199092+d +120582119882(d+119909)

bull SolvingforWwehave

W=

+119941

$(119941 )=

)G)+-+

HIJ()+-+

G K)

32

Summary of MAC protocols

sect channel partitioning by time frequency or codebull Time Division Frequency Division

sect 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

sect taking turnsbull polling from central site token passing slotted ringbull Bluetooth FDDI token ring Tornet

6-33Link Layer and LANs

33

Link layer LANs outline

61 introduction services62 multiple access

protocols63 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

64 error detection correction

65 data center networking

66 a day in the life of a web request

6-34Link Layer and LANs

34

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

Metcalfersquos Ethernet sketch

6-35Link Layer and LANs

35

Ethernet physical topologysect bus popular through mid 90s

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

sect star prevails todaybull active switch in center

bull each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

6-36Link Layer and LANs

36

7

Ethernet frame structure

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

preamble sect 7 bytes with pattern 10101010 followed by one

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

destaddress

sourceaddress

data (payload) CRCpreamble

type

6-37Link Layer and LANs

37

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

bull 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

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

sect CRC cyclic redundancy check at receiverbull error detected frame is dropped

destaddress source

address data (payload) CRCpreamble

type

6-38Link Layer and LANs

38

Ethernet unreliable connectionless

sect connectionless no handshaking between sending and receiving NICs

sect 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

sect Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

6-39Link Layer and LANs

39

8023 Ethernet standards link amp physical layers

sect 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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

6-40Link Layer and LANs

40

Switches vs routers

both are store-and-forward sect routers network-layer

devices (examine network-layer headers)

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

both have forwarding tablessect routers compute tables using

routing algorithms IP addresses

sect switches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frameframe

framedatagram

6-41Link Layer and LANs

41Network Layer 4-42

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

CollisionInterference

42

8

Network Layer 4-43

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

1 Each input node generates Connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a nodeWill try again in the next slot time with theSame probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

43Network Layer 4-44

1 Each input node generates connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a node will try again in the next slot time with the same probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

The prob that an input node tries to connect to an output node is pMThe prob that a request of an input node is not addressed to an output node is 1 - pMWhat is the probability that none of N input nodes requests for the output node

(1-pM)NWhat is the probability that at least one input node requests connection to that output node

1- (1-pM)N

How many connection in total can we have in a slot timeBW= M(1- (1-pM)N)

Assume Ngt=MHomework Use this same analytical technique to analyze an 120512minus 119951119942119957119960119952119955119948

44

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-45Link Layer and LANs

45

Data center networks

sect 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)

sect challengessect multiple applications each

serving massive numbers of clients

sect managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

6-46Link Layer and LANs

46

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 routingsect receives external client requestssect directs workload within data centersect returns results to external client (hiding data

center internals from client)

6-47Link Layer and LANs

Internet

47

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks sect rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

6-48Link Layer and LANs

48

9

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-49Link Layer and LANs

49

Synthesis a day in the life of a web request

sect journey down protocol stack completebull application transport network link

sect 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

6-50Link Layer and LANs

50

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

6-51Link Layer and LANs

51

router(runs DHCP)

A day in the lifehellip connecting to the Internet

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

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

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

sect Ethernet demuxed to IP demuxed UDP demuxed to DHCP

6-52Link Layer and LANs

52

router(runs DHCP)

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

sect 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

sect DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

6-53Link Layer and LANs

53

router(runs DHCP)

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

sect before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDPIPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

6-54Link Layer and LANs

54

10

router(runs DHCP)

DNSUDPIPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

sect demuxed to DNS serversect DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDPIPEthPhy

DNS

DNS

DNS

DNS

A day in the lifehellip using DNS

6-55Link Layer and LANs

55

router(runs DHCP)

A day in the lifehellipTCP connection carrying HTTP

HTTPTCPIPEthPhy

HTTP

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

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

sect TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIPEthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

6-56Link Layer and LANs

56

router(runs DHCP)

A day in the lifehellip HTTP requestreply HTTPTCPIPEthPhy

HTTP

sect HTTP request sent into TCP socket

sect IP datagram containing HTTP request routed to wwwgooglecom

sect IP datagram containing HTTP reply routed back to client

64233169105web server

HTTPTCPIPEthPhy

sect web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

sect web page finally () displayed

6-57Link Layer and LANs

57

Chapter 6 Summarysect principles behind data link layer services

bull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

sect instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS VLANsbull virtualized networks as a link layer MPLS

sect synthesis a day in the life of a web request

6-58Link Layer and LANs

58

Chapter 6 letrsquos take a breath

sect journey down protocol stack complete (except PHY)

sect solid understanding of networking principles practice

sect hellip could stop here hellip but lots of interesting topicsbull wirelessbull multimediabull security

6-59Link Layer and LANs

59

Page 5: Chapter 6: Link layer and LANs Link layer, LANs: outlineqyang/ele543/2020/Lecture7LAN.pdf · 2020-03-31 · §example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle

5

CSMACD (collision detection)

spatial layout of nodes

6-25Link Layer and LANs

25

Ethernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

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

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

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

5 After aborting NIC enters binary (exponential) backoff 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

6-26Link Layer and LANs

26

ldquoTaking turnsrdquo MAC protocols

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

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

sect efficient at low load single node can fully utilize channel

sect high load collision overheadldquotaking turnsrdquo protocols

look for best of both worlds

6-27Link Layer and LANs

27

pollingsect master node ldquoinvitesrdquo

slave nodes to transmit in turn

sect typically used with ldquodumbrdquo slave devices

sect concernsbull polling overhead bull latencybull single point of

failure (master)

master

slaves

poll

data

data

ldquoTaking turnsrdquo MAC protocols

6-28Link Layer and LANs

28

token passingsect control token passed from

one node to next sequentially

sect token messagesect concerns

sect token overhead sect latencysect single point of failure

(token)

T

data

(nothingto send)

T

ldquoTaking turnsrdquo MAC protocols

6-29Link Layer and LANs

29

Multiple Slotssect Flag at the beginning of a

slot indicating busyidlesect Transmit if idle and set

busysect If F busy try next slot

Delay Analysissect Let ring utilization be

U it is the probability that a slot is busy

S

data

(nothingto send)

S

ldquoSlotted Ringrdquo MAC protocols

6-30Link Layer and LANs

F

F

F

F

30

6

sect Suppose data packets arrives at the queue with rate 120582 following Poison Distribution

sect Ring utilization U

sect Slot length x in bits timesect Delay includes

1 Queue delay with queue length Q from the time the packet arrives until it reaches the head

2 Access delay d finding an empty slot after reaching queue head and filling the slot

S

data

(nothingto send)

S

ldquoSlotted Ringrdquo Performance Analysis

6-31Link Layer and LANs

F

F

F

F

AccessQueue

Flag IndicatingBusyidle slot

31

ldquoSlotted Ringrdquo Performance Analysis

6-32Link Layer and LANs

119941 = 119909119880 1 minus 119880 + 21199091198802(1 minus 119880)+3119909U3(1-U)+helliphellip=sum$

119894119909119880(1 minus 119880) = amp()

bull Upon arrival of a packet to the queue the packet has to wait for all packets before it in the queue to finish Therefore the wait time of the arrival packet is given by

W=1199092+d +Q(d+119909)bull FromLittlersquosLaw

Q=120582119882W=1199092+d +120582119882(d+119909)

bull SolvingforWwehave

W=

+119941

$(119941 )=

)G)+-+

HIJ()+-+

G K)

32

Summary of MAC protocols

sect channel partitioning by time frequency or codebull Time Division Frequency Division

sect 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

sect taking turnsbull polling from central site token passing slotted ringbull Bluetooth FDDI token ring Tornet

6-33Link Layer and LANs

33

Link layer LANs outline

61 introduction services62 multiple access

protocols63 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

64 error detection correction

65 data center networking

66 a day in the life of a web request

6-34Link Layer and LANs

34

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

Metcalfersquos Ethernet sketch

6-35Link Layer and LANs

35

Ethernet physical topologysect bus popular through mid 90s

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

sect star prevails todaybull active switch in center

bull each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

6-36Link Layer and LANs

36

7

Ethernet frame structure

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

preamble sect 7 bytes with pattern 10101010 followed by one

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

destaddress

sourceaddress

data (payload) CRCpreamble

type

6-37Link Layer and LANs

37

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

bull 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

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

sect CRC cyclic redundancy check at receiverbull error detected frame is dropped

destaddress source

address data (payload) CRCpreamble

type

6-38Link Layer and LANs

38

Ethernet unreliable connectionless

sect connectionless no handshaking between sending and receiving NICs

sect 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

sect Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

6-39Link Layer and LANs

39

8023 Ethernet standards link amp physical layers

sect 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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

6-40Link Layer and LANs

40

Switches vs routers

both are store-and-forward sect routers network-layer

devices (examine network-layer headers)

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

both have forwarding tablessect routers compute tables using

routing algorithms IP addresses

sect switches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frameframe

framedatagram

6-41Link Layer and LANs

41Network Layer 4-42

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

CollisionInterference

42

8

Network Layer 4-43

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

1 Each input node generates Connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a nodeWill try again in the next slot time with theSame probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

43Network Layer 4-44

1 Each input node generates connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a node will try again in the next slot time with the same probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

The prob that an input node tries to connect to an output node is pMThe prob that a request of an input node is not addressed to an output node is 1 - pMWhat is the probability that none of N input nodes requests for the output node

(1-pM)NWhat is the probability that at least one input node requests connection to that output node

1- (1-pM)N

How many connection in total can we have in a slot timeBW= M(1- (1-pM)N)

Assume Ngt=MHomework Use this same analytical technique to analyze an 120512minus 119951119942119957119960119952119955119948

44

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-45Link Layer and LANs

45

Data center networks

sect 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)

sect challengessect multiple applications each

serving massive numbers of clients

sect managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

6-46Link Layer and LANs

46

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 routingsect receives external client requestssect directs workload within data centersect returns results to external client (hiding data

center internals from client)

6-47Link Layer and LANs

Internet

47

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks sect rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

6-48Link Layer and LANs

48

9

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-49Link Layer and LANs

49

Synthesis a day in the life of a web request

sect journey down protocol stack completebull application transport network link

sect 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

6-50Link Layer and LANs

50

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

6-51Link Layer and LANs

51

router(runs DHCP)

A day in the lifehellip connecting to the Internet

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

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

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

sect Ethernet demuxed to IP demuxed UDP demuxed to DHCP

6-52Link Layer and LANs

52

router(runs DHCP)

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

sect 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

sect DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

6-53Link Layer and LANs

53

router(runs DHCP)

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

sect before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDPIPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

6-54Link Layer and LANs

54

10

router(runs DHCP)

DNSUDPIPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

sect demuxed to DNS serversect DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDPIPEthPhy

DNS

DNS

DNS

DNS

A day in the lifehellip using DNS

6-55Link Layer and LANs

55

router(runs DHCP)

A day in the lifehellipTCP connection carrying HTTP

HTTPTCPIPEthPhy

HTTP

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

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

sect TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIPEthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

6-56Link Layer and LANs

56

router(runs DHCP)

A day in the lifehellip HTTP requestreply HTTPTCPIPEthPhy

HTTP

sect HTTP request sent into TCP socket

sect IP datagram containing HTTP request routed to wwwgooglecom

sect IP datagram containing HTTP reply routed back to client

64233169105web server

HTTPTCPIPEthPhy

sect web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

sect web page finally () displayed

6-57Link Layer and LANs

57

Chapter 6 Summarysect principles behind data link layer services

bull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

sect instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS VLANsbull virtualized networks as a link layer MPLS

sect synthesis a day in the life of a web request

6-58Link Layer and LANs

58

Chapter 6 letrsquos take a breath

sect journey down protocol stack complete (except PHY)

sect solid understanding of networking principles practice

sect hellip could stop here hellip but lots of interesting topicsbull wirelessbull multimediabull security

6-59Link Layer and LANs

59

Page 6: Chapter 6: Link layer and LANs Link layer, LANs: outlineqyang/ele543/2020/Lecture7LAN.pdf · 2020-03-31 · §example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle

6

sect Suppose data packets arrives at the queue with rate 120582 following Poison Distribution

sect Ring utilization U

sect Slot length x in bits timesect Delay includes

1 Queue delay with queue length Q from the time the packet arrives until it reaches the head

2 Access delay d finding an empty slot after reaching queue head and filling the slot

S

data

(nothingto send)

S

ldquoSlotted Ringrdquo Performance Analysis

6-31Link Layer and LANs

F

F

F

F

AccessQueue

Flag IndicatingBusyidle slot

31

ldquoSlotted Ringrdquo Performance Analysis

6-32Link Layer and LANs

119941 = 119909119880 1 minus 119880 + 21199091198802(1 minus 119880)+3119909U3(1-U)+helliphellip=sum$

119894119909119880(1 minus 119880) = amp()

bull Upon arrival of a packet to the queue the packet has to wait for all packets before it in the queue to finish Therefore the wait time of the arrival packet is given by

W=1199092+d +Q(d+119909)bull FromLittlersquosLaw

Q=120582119882W=1199092+d +120582119882(d+119909)

bull SolvingforWwehave

W=

+119941

$(119941 )=

)G)+-+

HIJ()+-+

G K)

32

Summary of MAC protocols

sect channel partitioning by time frequency or codebull Time Division Frequency Division

sect 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

sect taking turnsbull polling from central site token passing slotted ringbull Bluetooth FDDI token ring Tornet

6-33Link Layer and LANs

33

Link layer LANs outline

61 introduction services62 multiple access

protocols63 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

64 error detection correction

65 data center networking

66 a day in the life of a web request

6-34Link Layer and LANs

34

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

Metcalfersquos Ethernet sketch

6-35Link Layer and LANs

35

Ethernet physical topologysect bus popular through mid 90s

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

sect star prevails todaybull active switch in center

bull each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do not collide with each other)

switch

bus coaxial cablestar

6-36Link Layer and LANs

36

7

Ethernet frame structure

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

preamble sect 7 bytes with pattern 10101010 followed by one

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

destaddress

sourceaddress

data (payload) CRCpreamble

type

6-37Link Layer and LANs

37

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

bull 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

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

sect CRC cyclic redundancy check at receiverbull error detected frame is dropped

destaddress source

address data (payload) CRCpreamble

type

6-38Link Layer and LANs

38

Ethernet unreliable connectionless

sect connectionless no handshaking between sending and receiving NICs

sect 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

sect Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

6-39Link Layer and LANs

39

8023 Ethernet standards link amp physical layers

sect 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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

6-40Link Layer and LANs

40

Switches vs routers

both are store-and-forward sect routers network-layer

devices (examine network-layer headers)

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

both have forwarding tablessect routers compute tables using

routing algorithms IP addresses

sect switches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frameframe

framedatagram

6-41Link Layer and LANs

41Network Layer 4-42

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

CollisionInterference

42

8

Network Layer 4-43

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

1 Each input node generates Connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a nodeWill try again in the next slot time with theSame probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

43Network Layer 4-44

1 Each input node generates connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a node will try again in the next slot time with the same probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

The prob that an input node tries to connect to an output node is pMThe prob that a request of an input node is not addressed to an output node is 1 - pMWhat is the probability that none of N input nodes requests for the output node

(1-pM)NWhat is the probability that at least one input node requests connection to that output node

1- (1-pM)N

How many connection in total can we have in a slot timeBW= M(1- (1-pM)N)

Assume Ngt=MHomework Use this same analytical technique to analyze an 120512minus 119951119942119957119960119952119955119948

44

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-45Link Layer and LANs

45

Data center networks

sect 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)

sect challengessect multiple applications each

serving massive numbers of clients

sect managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

6-46Link Layer and LANs

46

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 routingsect receives external client requestssect directs workload within data centersect returns results to external client (hiding data

center internals from client)

6-47Link Layer and LANs

Internet

47

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks sect rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

6-48Link Layer and LANs

48

9

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-49Link Layer and LANs

49

Synthesis a day in the life of a web request

sect journey down protocol stack completebull application transport network link

sect 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

6-50Link Layer and LANs

50

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

6-51Link Layer and LANs

51

router(runs DHCP)

A day in the lifehellip connecting to the Internet

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

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

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

sect Ethernet demuxed to IP demuxed UDP demuxed to DHCP

6-52Link Layer and LANs

52

router(runs DHCP)

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

sect 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

sect DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

6-53Link Layer and LANs

53

router(runs DHCP)

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

sect before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDPIPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

6-54Link Layer and LANs

54

10

router(runs DHCP)

DNSUDPIPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

sect demuxed to DNS serversect DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDPIPEthPhy

DNS

DNS

DNS

DNS

A day in the lifehellip using DNS

6-55Link Layer and LANs

55

router(runs DHCP)

A day in the lifehellipTCP connection carrying HTTP

HTTPTCPIPEthPhy

HTTP

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

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

sect TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIPEthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

6-56Link Layer and LANs

56

router(runs DHCP)

A day in the lifehellip HTTP requestreply HTTPTCPIPEthPhy

HTTP

sect HTTP request sent into TCP socket

sect IP datagram containing HTTP request routed to wwwgooglecom

sect IP datagram containing HTTP reply routed back to client

64233169105web server

HTTPTCPIPEthPhy

sect web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

sect web page finally () displayed

6-57Link Layer and LANs

57

Chapter 6 Summarysect principles behind data link layer services

bull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

sect instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS VLANsbull virtualized networks as a link layer MPLS

sect synthesis a day in the life of a web request

6-58Link Layer and LANs

58

Chapter 6 letrsquos take a breath

sect journey down protocol stack complete (except PHY)

sect solid understanding of networking principles practice

sect hellip could stop here hellip but lots of interesting topicsbull wirelessbull multimediabull security

6-59Link Layer and LANs

59

Page 7: Chapter 6: Link layer and LANs Link layer, LANs: outlineqyang/ele543/2020/Lecture7LAN.pdf · 2020-03-31 · §example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle

7

Ethernet frame structure

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

preamble sect 7 bytes with pattern 10101010 followed by one

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

destaddress

sourceaddress

data (payload) CRCpreamble

type

6-37Link Layer and LANs

37

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

bull 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

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

sect CRC cyclic redundancy check at receiverbull error detected frame is dropped

destaddress source

address data (payload) CRCpreamble

type

6-38Link Layer and LANs

38

Ethernet unreliable connectionless

sect connectionless no handshaking between sending and receiving NICs

sect 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

sect Ethernetrsquos MAC protocol unslotted CSMACD with binary backoff

6-39Link Layer and LANs

39

8023 Ethernet standards link amp physical layers

sect 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

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layercopper (twisterpair) physical layer

6-40Link Layer and LANs

40

Switches vs routers

both are store-and-forward sect routers network-layer

devices (examine network-layer headers)

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

both have forwarding tablessect routers compute tables using

routing algorithms IP addresses

sect switches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frameframe

framedatagram

6-41Link Layer and LANs

41Network Layer 4-42

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

CollisionInterference

42

8

Network Layer 4-43

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

1 Each input node generates Connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a nodeWill try again in the next slot time with theSame probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

43Network Layer 4-44

1 Each input node generates connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a node will try again in the next slot time with the same probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

The prob that an input node tries to connect to an output node is pMThe prob that a request of an input node is not addressed to an output node is 1 - pMWhat is the probability that none of N input nodes requests for the output node

(1-pM)NWhat is the probability that at least one input node requests connection to that output node

1- (1-pM)N

How many connection in total can we have in a slot timeBW= M(1- (1-pM)N)

Assume Ngt=MHomework Use this same analytical technique to analyze an 120512minus 119951119942119957119960119952119955119948

44

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-45Link Layer and LANs

45

Data center networks

sect 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)

sect challengessect multiple applications each

serving massive numbers of clients

sect managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

6-46Link Layer and LANs

46

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 routingsect receives external client requestssect directs workload within data centersect returns results to external client (hiding data

center internals from client)

6-47Link Layer and LANs

Internet

47

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks sect rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

6-48Link Layer and LANs

48

9

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-49Link Layer and LANs

49

Synthesis a day in the life of a web request

sect journey down protocol stack completebull application transport network link

sect 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

6-50Link Layer and LANs

50

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

6-51Link Layer and LANs

51

router(runs DHCP)

A day in the lifehellip connecting to the Internet

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

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

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

sect Ethernet demuxed to IP demuxed UDP demuxed to DHCP

6-52Link Layer and LANs

52

router(runs DHCP)

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

sect 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

sect DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

6-53Link Layer and LANs

53

router(runs DHCP)

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

sect before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDPIPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

6-54Link Layer and LANs

54

10

router(runs DHCP)

DNSUDPIPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

sect demuxed to DNS serversect DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDPIPEthPhy

DNS

DNS

DNS

DNS

A day in the lifehellip using DNS

6-55Link Layer and LANs

55

router(runs DHCP)

A day in the lifehellipTCP connection carrying HTTP

HTTPTCPIPEthPhy

HTTP

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

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

sect TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIPEthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

6-56Link Layer and LANs

56

router(runs DHCP)

A day in the lifehellip HTTP requestreply HTTPTCPIPEthPhy

HTTP

sect HTTP request sent into TCP socket

sect IP datagram containing HTTP request routed to wwwgooglecom

sect IP datagram containing HTTP reply routed back to client

64233169105web server

HTTPTCPIPEthPhy

sect web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

sect web page finally () displayed

6-57Link Layer and LANs

57

Chapter 6 Summarysect principles behind data link layer services

bull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

sect instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS VLANsbull virtualized networks as a link layer MPLS

sect synthesis a day in the life of a web request

6-58Link Layer and LANs

58

Chapter 6 letrsquos take a breath

sect journey down protocol stack complete (except PHY)

sect solid understanding of networking principles practice

sect hellip could stop here hellip but lots of interesting topicsbull wirelessbull multimediabull security

6-59Link Layer and LANs

59

Page 8: Chapter 6: Link layer and LANs Link layer, LANs: outlineqyang/ele543/2020/Lecture7LAN.pdf · 2020-03-31 · §example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle

8

Network Layer 4-43

N Inputs

M outputs

switch

Crossbar switchHW cost O(NM)

12

N

iii

M

3

ii iii

1 Each input node generates Connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a nodeWill try again in the next slot time with theSame probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

43Network Layer 4-44

1 Each input node generates connection request with probability p at the beginning of each slot time2 The connection request goes to any one of M outputs equally likely3 If connection request failed a node will try again in the next slot time with the same probability p

Estimate Average number of successful connections per slot time BW (bandwidth)

The prob that an input node tries to connect to an output node is pMThe prob that a request of an input node is not addressed to an output node is 1 - pMWhat is the probability that none of N input nodes requests for the output node

(1-pM)NWhat is the probability that at least one input node requests connection to that output node

1- (1-pM)N

How many connection in total can we have in a slot timeBW= M(1- (1-pM)N)

Assume Ngt=MHomework Use this same analytical technique to analyze an 120512minus 119951119942119957119960119952119955119948

44

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-45Link Layer and LANs

45

Data center networks

sect 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)

sect challengessect multiple applications each

serving massive numbers of clients

sect managingbalancing load avoiding processing networking data bottlenecks

Inside a 40-ft Microsoft container Chicago data center

6-46Link Layer and LANs

46

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 routingsect receives external client requestssect directs workload within data centersect returns results to external client (hiding data

center internals from client)

6-47Link Layer and LANs

Internet

47

Server racks

TOR switches

Tier-1 switches

Tier-2 switches

1 2 3 4 5 6 7 8

Data center networks sect rich interconnection among switches racks

bull increased throughput between racks (multiple routing paths possible)

bull increased reliability via redundancy

6-48Link Layer and LANs

48

9

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-49Link Layer and LANs

49

Synthesis a day in the life of a web request

sect journey down protocol stack completebull application transport network link

sect 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

6-50Link Layer and LANs

50

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

6-51Link Layer and LANs

51

router(runs DHCP)

A day in the lifehellip connecting to the Internet

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

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

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

sect Ethernet demuxed to IP demuxed UDP demuxed to DHCP

6-52Link Layer and LANs

52

router(runs DHCP)

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

sect 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

sect DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

6-53Link Layer and LANs

53

router(runs DHCP)

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

sect before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDPIPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

6-54Link Layer and LANs

54

10

router(runs DHCP)

DNSUDPIPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

sect demuxed to DNS serversect DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDPIPEthPhy

DNS

DNS

DNS

DNS

A day in the lifehellip using DNS

6-55Link Layer and LANs

55

router(runs DHCP)

A day in the lifehellipTCP connection carrying HTTP

HTTPTCPIPEthPhy

HTTP

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

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

sect TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIPEthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

6-56Link Layer and LANs

56

router(runs DHCP)

A day in the lifehellip HTTP requestreply HTTPTCPIPEthPhy

HTTP

sect HTTP request sent into TCP socket

sect IP datagram containing HTTP request routed to wwwgooglecom

sect IP datagram containing HTTP reply routed back to client

64233169105web server

HTTPTCPIPEthPhy

sect web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

sect web page finally () displayed

6-57Link Layer and LANs

57

Chapter 6 Summarysect principles behind data link layer services

bull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

sect instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS VLANsbull virtualized networks as a link layer MPLS

sect synthesis a day in the life of a web request

6-58Link Layer and LANs

58

Chapter 6 letrsquos take a breath

sect journey down protocol stack complete (except PHY)

sect solid understanding of networking principles practice

sect hellip could stop here hellip but lots of interesting topicsbull wirelessbull multimediabull security

6-59Link Layer and LANs

59

Page 9: Chapter 6: Link layer and LANs Link layer, LANs: outlineqyang/ele543/2020/Lecture7LAN.pdf · 2020-03-31 · §example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle

9

Link layer LANs outline

61 introduction services62 error detection

correction 63 multiple access

protocols64 LANs

bull addressing ARPbull Ethernetbull switchesbull VLANS

65 data center networking

66 a day in the life of a web request

6-49Link Layer and LANs

49

Synthesis a day in the life of a web request

sect journey down protocol stack completebull application transport network link

sect 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

6-50Link Layer and LANs

50

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

web page

browser

6-51Link Layer and LANs

51

router(runs DHCP)

A day in the lifehellip connecting to the Internet

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

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

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

sect Ethernet demuxed to IP demuxed UDP demuxed to DHCP

6-52Link Layer and LANs

52

router(runs DHCP)

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

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDPIPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

sect 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

sect DHCP client receives DHCP ACK reply

A day in the lifehellip connecting to the Internet

6-53Link Layer and LANs

53

router(runs DHCP)

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

sect before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDPIPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

6-54Link Layer and LANs

54

10

router(runs DHCP)

DNSUDPIPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

sect demuxed to DNS serversect DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDPIPEthPhy

DNS

DNS

DNS

DNS

A day in the lifehellip using DNS

6-55Link Layer and LANs

55

router(runs DHCP)

A day in the lifehellipTCP connection carrying HTTP

HTTPTCPIPEthPhy

HTTP

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

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

sect TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIPEthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

6-56Link Layer and LANs

56

router(runs DHCP)

A day in the lifehellip HTTP requestreply HTTPTCPIPEthPhy

HTTP

sect HTTP request sent into TCP socket

sect IP datagram containing HTTP request routed to wwwgooglecom

sect IP datagram containing HTTP reply routed back to client

64233169105web server

HTTPTCPIPEthPhy

sect web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

sect web page finally () displayed

6-57Link Layer and LANs

57

Chapter 6 Summarysect principles behind data link layer services

bull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

sect instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS VLANsbull virtualized networks as a link layer MPLS

sect synthesis a day in the life of a web request

6-58Link Layer and LANs

58

Chapter 6 letrsquos take a breath

sect journey down protocol stack complete (except PHY)

sect solid understanding of networking principles practice

sect hellip could stop here hellip but lots of interesting topicsbull wirelessbull multimediabull security

6-59Link Layer and LANs

59

Page 10: Chapter 6: Link layer and LANs Link layer, LANs: outlineqyang/ele543/2020/Lecture7LAN.pdf · 2020-03-31 · §example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle

10

router(runs DHCP)

DNSUDPIPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

sect demuxed to DNS serversect DNS server replies to client

with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDPIPEthPhy

DNS

DNS

DNS

DNS

A day in the lifehellip using DNS

6-55Link Layer and LANs

55

router(runs DHCP)

A day in the lifehellipTCP connection carrying HTTP

HTTPTCPIPEthPhy

HTTP

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

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

sect TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIPEthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

6-56Link Layer and LANs

56

router(runs DHCP)

A day in the lifehellip HTTP requestreply HTTPTCPIPEthPhy

HTTP

sect HTTP request sent into TCP socket

sect IP datagram containing HTTP request routed to wwwgooglecom

sect IP datagram containing HTTP reply routed back to client

64233169105web server

HTTPTCPIPEthPhy

sect web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

sect web page finally () displayed

6-57Link Layer and LANs

57

Chapter 6 Summarysect principles behind data link layer services

bull error detection correctionbull sharing a broadcast channel multiple accessbull link layer addressing

sect instantiation and implementation of various link layer technologiesbull Ethernetbull switched LANS VLANsbull virtualized networks as a link layer MPLS

sect synthesis a day in the life of a web request

6-58Link Layer and LANs

58

Chapter 6 letrsquos take a breath

sect journey down protocol stack complete (except PHY)

sect solid understanding of networking principles practice

sect hellip could stop here hellip but lots of interesting topicsbull wirelessbull multimediabull security

6-59Link Layer and LANs

59