data link control · 2011. 2. 24. · data link control - roadmap introduction and services 22 data...

60
Data Communications & Networks Session 4 – Main Theme Data Link Control Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences Adapted from course textbook resources Computer Networking: A Top-Down Approach, 5/E Copyright 1996-2009 J.F. Kurose and K.W. Ross, All Rights Reserved 2 2 Data Link Control Data Link Control Agenda 1 Session Overview Session Overview 3 Summary and Conclusion Summary and Conclusion

Upload: others

Post on 04-Oct-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

1

Data Communications amp Networks

Session 4 ndash Main ThemeData Link Control

Dr Jean-Claude Franchitti

New York UniversityComputer Science Department

Courant Institute of Mathematical Sciences

Adapted from course textbook resourcesComputer Networking A Top-Down Approach 5E

Copyright 1996-2009JF Kurose and KW Ross All Rights Reserved

2

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

3

What is the class about

Course description and syllabusraquohttpwwwnyueduclassesjcfg222262-001

raquohttpwwwcsnyueducoursesspring10G222262-001indexhtml

Textbooksraquo Computer Networking A Top-Down Approach (5th Edition)

James F Kurose Keith W RossAddison WesleyISBN-10 0136079679 ISBN-13 978-0136079675 5th Edition (0309)

4

Course Overview

Computer Networks and the InternetApplication LayerFundamental Data Structures queues ring buffers finite state machinesData Encoding and TransmissionLocal Area Networks and Data Link ControlWireless CommunicationsPacket SwitchingOSI and Internet Protocol ArchitectureCongestion Control and Flow Control MethodsInternet Protocols (IP ARP UDP TCP)Network (packet) Routing Algorithms (OSPF Distance Vector)IP MulticastSockets

5

Principles Behind Data Link Layer Services Error Detection and CorrectionSharing a Broadcast Channel Multiple AccessLink-Layer AddressingReliable Data Transfer and Flow Control

Instantiation and implementation of various link layer technologies

EthernetLink-layer switchesPPPLink virtualization MPLSA day in the life of a web request

Data Link Control Session in Brief

6

Icons Metaphors

6

Common Realization

Information

KnowledgeCompetency Pattern

Governance

Alignment

Solution Approach

7

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

8

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

9

Link Layer Introduction

Some terminologyhosts and routers are nodescommunication channels that connect adjacent nodes along communication path are linksraquo wired linksraquo wireless linksraquo LANs

layer-2 packet is a frameencapsulates datagram

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

10

Link layer context

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

frame relay on intermediate links 80211 on last link

each link protocol provides different servicesraquo eg may or may not provide

rdt over link

transportation analogytrip from Princeton to Lausanneraquo limo Princeton to JFKraquo plane JFK to Genevaraquo train Geneva to Lausanne

tourist = datagramtransport segment = communication linktransportation mode = link layer protocoltravel agent = routing algorithm

11

Link Layer Services (12)

Framing link accessEncapsulate datagram into frame adding header trailerChannel access if shared mediumldquoMACrdquo addresses used in frame headers to identify source dest

Different from IP address

Reliable delivery between adjacent nodesWe briefly discussed how to do this alreadySeldom used on low bit error link (fiber some twisted pair)Wireless links high error rates

Q why both link-level and end-end reliability

12

Link Layer Services (22)

Flow ControlPacing between adjacent sending and receiving nodes

Error DetectionErrors caused by signal attenuation noiseReceiver detects presence of errors

Signals sender for retransmission or drops frame

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

Half-duplex and full-duplexWith half duplex nodes at both ends of link can transmit but not at same time

13

Where is the link layer implemented

in each and every hostlink layer implemented in ldquoadaptorrdquo (aka network interface card NIC)raquo Ethernet card PCMCI card

80211 cardraquo implements link physical

layer

attaches into hostrsquos system busescombination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

host schematic

applicationtransportnetwork

link

linkphysical

14

Adaptors Communicating

sending sideraquo encapsulates datagram in

frameraquo adds error checking bits

rdt flow control etc

receiving sideraquo looks for errors rdt flow

control etcraquo extracts datagram passes

to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

15

Encoding Information Frames

Typical Fields in a Frame

StartFrame

Delimiter

SourceAddress

DestinationAddress

FrameControl Data Check

sum

16

DLL Operation

NL

DLL

PL

Retransmitif timeout

ACK ifcorrectFrame

CRC

ACKCRC

Sender Receiver

correct and ordered

17

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

18

Error Detection

EDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields

bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction

otherwise

19

Error Detection

Additional bits added by transmitter for error detection code

ParityValue of parity bit is such that character has even (even parity) or odd (odd parity) number of onesEven number of bit errors goes undetectedChecksum can be a simple XOR operation of bits to be checked

DL protocols use more sophisticated methods like Cyclic Redundancy Check (CRC)

20

Parity Checking

Single Bit ParityDetect single bit errors

Two Dimensional Bit ParityDetect and correct single bit errors

0 0

21

Internet Checksum

Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer only)

SenderTreat segment contents as sequence of 16-bit integersChecksum addition (1rsquos complement sum) of segment contentsSender puts checksum value into UDP checksum field

ReceiverCompute checksum of received segmentCheck if computed checksum equals checksum field value

NO - error detectedYES - no error detected But maybe errors nonethelessMore later hellip

22

Checksuming Cyclic Redundancy Check

View data bits D as a binary numberChoose r+1 bit pattern (generator) G Goal choose r CRC bits R such that

ltDRgt exactly divisible by G (modulo 2)Receiver knows G divides ltDRgt by G If non-zero remainder error detectedCan detect all burst errors less than r+1 bits

Widely used in practice (ATM HDLC)

23

CRC Example

WantD2r XOR R = nG

EquivalentlyD2r = nG XOR R

Equivalently if we divide D2r by G

want remainder R

R = remainder[ ]D2r

G

24

Example of G(x) Polynomials

CRC-12X12 + X11 + X3 + X2 + X + 1

CRC-16X16 + X15 + X2 + 1

CRC-CCITTX16 + X15 + X5 + 1

CRC-32X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10

+ X8 + X7 + X5 + X4 + X2 + X + 1

CRCrsquos Are Implemented in Shift registers

25

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

26

Multiple Access Links and Protocols (12)

Two types of ldquolinksrdquoPoint-to-point

PPP for dial-up accessPoint-to-point link between Ethernet switch and host

Broadcast (shared wire or medium)Old-fashioned EthernetUpstream HFC80211 wireless LAN

27

Multiple Access Protocols (22)

Single shared broadcast channel Two or more simultaneous transmissions by nodes interference

Collision if node receives two or more signals at the same time

Multiple access protocolDistributed algorithm that determines how nodes share channel ie determine when node can transmitCommunication about channel sharing must use channel itself

28

Ideal Multiple Access Protocols

Broadcast channel of rate R bps1 When one node wants to transmit it can send at

rate R2 When M nodes want to transmit each can send

at average rate RM3 Fully decentralized

No special node to coordinate transmissionsNo synchronization of clocks slots

4 Simple

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 2: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

3

What is the class about

Course description and syllabusraquohttpwwwnyueduclassesjcfg222262-001

raquohttpwwwcsnyueducoursesspring10G222262-001indexhtml

Textbooksraquo Computer Networking A Top-Down Approach (5th Edition)

James F Kurose Keith W RossAddison WesleyISBN-10 0136079679 ISBN-13 978-0136079675 5th Edition (0309)

4

Course Overview

Computer Networks and the InternetApplication LayerFundamental Data Structures queues ring buffers finite state machinesData Encoding and TransmissionLocal Area Networks and Data Link ControlWireless CommunicationsPacket SwitchingOSI and Internet Protocol ArchitectureCongestion Control and Flow Control MethodsInternet Protocols (IP ARP UDP TCP)Network (packet) Routing Algorithms (OSPF Distance Vector)IP MulticastSockets

5

Principles Behind Data Link Layer Services Error Detection and CorrectionSharing a Broadcast Channel Multiple AccessLink-Layer AddressingReliable Data Transfer and Flow Control

Instantiation and implementation of various link layer technologies

EthernetLink-layer switchesPPPLink virtualization MPLSA day in the life of a web request

Data Link Control Session in Brief

6

Icons Metaphors

6

Common Realization

Information

KnowledgeCompetency Pattern

Governance

Alignment

Solution Approach

7

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

8

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

9

Link Layer Introduction

Some terminologyhosts and routers are nodescommunication channels that connect adjacent nodes along communication path are linksraquo wired linksraquo wireless linksraquo LANs

layer-2 packet is a frameencapsulates datagram

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

10

Link layer context

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

frame relay on intermediate links 80211 on last link

each link protocol provides different servicesraquo eg may or may not provide

rdt over link

transportation analogytrip from Princeton to Lausanneraquo limo Princeton to JFKraquo plane JFK to Genevaraquo train Geneva to Lausanne

tourist = datagramtransport segment = communication linktransportation mode = link layer protocoltravel agent = routing algorithm

11

Link Layer Services (12)

Framing link accessEncapsulate datagram into frame adding header trailerChannel access if shared mediumldquoMACrdquo addresses used in frame headers to identify source dest

Different from IP address

Reliable delivery between adjacent nodesWe briefly discussed how to do this alreadySeldom used on low bit error link (fiber some twisted pair)Wireless links high error rates

Q why both link-level and end-end reliability

12

Link Layer Services (22)

Flow ControlPacing between adjacent sending and receiving nodes

Error DetectionErrors caused by signal attenuation noiseReceiver detects presence of errors

Signals sender for retransmission or drops frame

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

Half-duplex and full-duplexWith half duplex nodes at both ends of link can transmit but not at same time

13

Where is the link layer implemented

in each and every hostlink layer implemented in ldquoadaptorrdquo (aka network interface card NIC)raquo Ethernet card PCMCI card

80211 cardraquo implements link physical

layer

attaches into hostrsquos system busescombination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

host schematic

applicationtransportnetwork

link

linkphysical

14

Adaptors Communicating

sending sideraquo encapsulates datagram in

frameraquo adds error checking bits

rdt flow control etc

receiving sideraquo looks for errors rdt flow

control etcraquo extracts datagram passes

to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

15

Encoding Information Frames

Typical Fields in a Frame

StartFrame

Delimiter

SourceAddress

DestinationAddress

FrameControl Data Check

sum

16

DLL Operation

NL

DLL

PL

Retransmitif timeout

ACK ifcorrectFrame

CRC

ACKCRC

Sender Receiver

correct and ordered

17

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

18

Error Detection

EDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields

bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction

otherwise

19

Error Detection

Additional bits added by transmitter for error detection code

ParityValue of parity bit is such that character has even (even parity) or odd (odd parity) number of onesEven number of bit errors goes undetectedChecksum can be a simple XOR operation of bits to be checked

DL protocols use more sophisticated methods like Cyclic Redundancy Check (CRC)

20

Parity Checking

Single Bit ParityDetect single bit errors

Two Dimensional Bit ParityDetect and correct single bit errors

0 0

21

Internet Checksum

Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer only)

SenderTreat segment contents as sequence of 16-bit integersChecksum addition (1rsquos complement sum) of segment contentsSender puts checksum value into UDP checksum field

ReceiverCompute checksum of received segmentCheck if computed checksum equals checksum field value

NO - error detectedYES - no error detected But maybe errors nonethelessMore later hellip

22

Checksuming Cyclic Redundancy Check

View data bits D as a binary numberChoose r+1 bit pattern (generator) G Goal choose r CRC bits R such that

ltDRgt exactly divisible by G (modulo 2)Receiver knows G divides ltDRgt by G If non-zero remainder error detectedCan detect all burst errors less than r+1 bits

Widely used in practice (ATM HDLC)

23

CRC Example

WantD2r XOR R = nG

EquivalentlyD2r = nG XOR R

Equivalently if we divide D2r by G

want remainder R

R = remainder[ ]D2r

G

24

Example of G(x) Polynomials

CRC-12X12 + X11 + X3 + X2 + X + 1

CRC-16X16 + X15 + X2 + 1

CRC-CCITTX16 + X15 + X5 + 1

CRC-32X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10

+ X8 + X7 + X5 + X4 + X2 + X + 1

CRCrsquos Are Implemented in Shift registers

25

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

26

Multiple Access Links and Protocols (12)

Two types of ldquolinksrdquoPoint-to-point

PPP for dial-up accessPoint-to-point link between Ethernet switch and host

Broadcast (shared wire or medium)Old-fashioned EthernetUpstream HFC80211 wireless LAN

27

Multiple Access Protocols (22)

Single shared broadcast channel Two or more simultaneous transmissions by nodes interference

Collision if node receives two or more signals at the same time

Multiple access protocolDistributed algorithm that determines how nodes share channel ie determine when node can transmitCommunication about channel sharing must use channel itself

28

Ideal Multiple Access Protocols

Broadcast channel of rate R bps1 When one node wants to transmit it can send at

rate R2 When M nodes want to transmit each can send

at average rate RM3 Fully decentralized

No special node to coordinate transmissionsNo synchronization of clocks slots

4 Simple

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 3: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

5

Principles Behind Data Link Layer Services Error Detection and CorrectionSharing a Broadcast Channel Multiple AccessLink-Layer AddressingReliable Data Transfer and Flow Control

Instantiation and implementation of various link layer technologies

EthernetLink-layer switchesPPPLink virtualization MPLSA day in the life of a web request

Data Link Control Session in Brief

6

Icons Metaphors

6

Common Realization

Information

KnowledgeCompetency Pattern

Governance

Alignment

Solution Approach

7

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

8

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

9

Link Layer Introduction

Some terminologyhosts and routers are nodescommunication channels that connect adjacent nodes along communication path are linksraquo wired linksraquo wireless linksraquo LANs

layer-2 packet is a frameencapsulates datagram

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

10

Link layer context

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

frame relay on intermediate links 80211 on last link

each link protocol provides different servicesraquo eg may or may not provide

rdt over link

transportation analogytrip from Princeton to Lausanneraquo limo Princeton to JFKraquo plane JFK to Genevaraquo train Geneva to Lausanne

tourist = datagramtransport segment = communication linktransportation mode = link layer protocoltravel agent = routing algorithm

11

Link Layer Services (12)

Framing link accessEncapsulate datagram into frame adding header trailerChannel access if shared mediumldquoMACrdquo addresses used in frame headers to identify source dest

Different from IP address

Reliable delivery between adjacent nodesWe briefly discussed how to do this alreadySeldom used on low bit error link (fiber some twisted pair)Wireless links high error rates

Q why both link-level and end-end reliability

12

Link Layer Services (22)

Flow ControlPacing between adjacent sending and receiving nodes

Error DetectionErrors caused by signal attenuation noiseReceiver detects presence of errors

Signals sender for retransmission or drops frame

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

Half-duplex and full-duplexWith half duplex nodes at both ends of link can transmit but not at same time

13

Where is the link layer implemented

in each and every hostlink layer implemented in ldquoadaptorrdquo (aka network interface card NIC)raquo Ethernet card PCMCI card

80211 cardraquo implements link physical

layer

attaches into hostrsquos system busescombination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

host schematic

applicationtransportnetwork

link

linkphysical

14

Adaptors Communicating

sending sideraquo encapsulates datagram in

frameraquo adds error checking bits

rdt flow control etc

receiving sideraquo looks for errors rdt flow

control etcraquo extracts datagram passes

to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

15

Encoding Information Frames

Typical Fields in a Frame

StartFrame

Delimiter

SourceAddress

DestinationAddress

FrameControl Data Check

sum

16

DLL Operation

NL

DLL

PL

Retransmitif timeout

ACK ifcorrectFrame

CRC

ACKCRC

Sender Receiver

correct and ordered

17

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

18

Error Detection

EDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields

bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction

otherwise

19

Error Detection

Additional bits added by transmitter for error detection code

ParityValue of parity bit is such that character has even (even parity) or odd (odd parity) number of onesEven number of bit errors goes undetectedChecksum can be a simple XOR operation of bits to be checked

DL protocols use more sophisticated methods like Cyclic Redundancy Check (CRC)

20

Parity Checking

Single Bit ParityDetect single bit errors

Two Dimensional Bit ParityDetect and correct single bit errors

0 0

21

Internet Checksum

Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer only)

SenderTreat segment contents as sequence of 16-bit integersChecksum addition (1rsquos complement sum) of segment contentsSender puts checksum value into UDP checksum field

ReceiverCompute checksum of received segmentCheck if computed checksum equals checksum field value

NO - error detectedYES - no error detected But maybe errors nonethelessMore later hellip

22

Checksuming Cyclic Redundancy Check

View data bits D as a binary numberChoose r+1 bit pattern (generator) G Goal choose r CRC bits R such that

ltDRgt exactly divisible by G (modulo 2)Receiver knows G divides ltDRgt by G If non-zero remainder error detectedCan detect all burst errors less than r+1 bits

Widely used in practice (ATM HDLC)

23

CRC Example

WantD2r XOR R = nG

EquivalentlyD2r = nG XOR R

Equivalently if we divide D2r by G

want remainder R

R = remainder[ ]D2r

G

24

Example of G(x) Polynomials

CRC-12X12 + X11 + X3 + X2 + X + 1

CRC-16X16 + X15 + X2 + 1

CRC-CCITTX16 + X15 + X5 + 1

CRC-32X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10

+ X8 + X7 + X5 + X4 + X2 + X + 1

CRCrsquos Are Implemented in Shift registers

25

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

26

Multiple Access Links and Protocols (12)

Two types of ldquolinksrdquoPoint-to-point

PPP for dial-up accessPoint-to-point link between Ethernet switch and host

Broadcast (shared wire or medium)Old-fashioned EthernetUpstream HFC80211 wireless LAN

27

Multiple Access Protocols (22)

Single shared broadcast channel Two or more simultaneous transmissions by nodes interference

Collision if node receives two or more signals at the same time

Multiple access protocolDistributed algorithm that determines how nodes share channel ie determine when node can transmitCommunication about channel sharing must use channel itself

28

Ideal Multiple Access Protocols

Broadcast channel of rate R bps1 When one node wants to transmit it can send at

rate R2 When M nodes want to transmit each can send

at average rate RM3 Fully decentralized

No special node to coordinate transmissionsNo synchronization of clocks slots

4 Simple

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 4: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

7

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

8

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

9

Link Layer Introduction

Some terminologyhosts and routers are nodescommunication channels that connect adjacent nodes along communication path are linksraquo wired linksraquo wireless linksraquo LANs

layer-2 packet is a frameencapsulates datagram

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

10

Link layer context

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

frame relay on intermediate links 80211 on last link

each link protocol provides different servicesraquo eg may or may not provide

rdt over link

transportation analogytrip from Princeton to Lausanneraquo limo Princeton to JFKraquo plane JFK to Genevaraquo train Geneva to Lausanne

tourist = datagramtransport segment = communication linktransportation mode = link layer protocoltravel agent = routing algorithm

11

Link Layer Services (12)

Framing link accessEncapsulate datagram into frame adding header trailerChannel access if shared mediumldquoMACrdquo addresses used in frame headers to identify source dest

Different from IP address

Reliable delivery between adjacent nodesWe briefly discussed how to do this alreadySeldom used on low bit error link (fiber some twisted pair)Wireless links high error rates

Q why both link-level and end-end reliability

12

Link Layer Services (22)

Flow ControlPacing between adjacent sending and receiving nodes

Error DetectionErrors caused by signal attenuation noiseReceiver detects presence of errors

Signals sender for retransmission or drops frame

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

Half-duplex and full-duplexWith half duplex nodes at both ends of link can transmit but not at same time

13

Where is the link layer implemented

in each and every hostlink layer implemented in ldquoadaptorrdquo (aka network interface card NIC)raquo Ethernet card PCMCI card

80211 cardraquo implements link physical

layer

attaches into hostrsquos system busescombination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

host schematic

applicationtransportnetwork

link

linkphysical

14

Adaptors Communicating

sending sideraquo encapsulates datagram in

frameraquo adds error checking bits

rdt flow control etc

receiving sideraquo looks for errors rdt flow

control etcraquo extracts datagram passes

to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

15

Encoding Information Frames

Typical Fields in a Frame

StartFrame

Delimiter

SourceAddress

DestinationAddress

FrameControl Data Check

sum

16

DLL Operation

NL

DLL

PL

Retransmitif timeout

ACK ifcorrectFrame

CRC

ACKCRC

Sender Receiver

correct and ordered

17

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

18

Error Detection

EDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields

bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction

otherwise

19

Error Detection

Additional bits added by transmitter for error detection code

ParityValue of parity bit is such that character has even (even parity) or odd (odd parity) number of onesEven number of bit errors goes undetectedChecksum can be a simple XOR operation of bits to be checked

DL protocols use more sophisticated methods like Cyclic Redundancy Check (CRC)

20

Parity Checking

Single Bit ParityDetect single bit errors

Two Dimensional Bit ParityDetect and correct single bit errors

0 0

21

Internet Checksum

Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer only)

SenderTreat segment contents as sequence of 16-bit integersChecksum addition (1rsquos complement sum) of segment contentsSender puts checksum value into UDP checksum field

ReceiverCompute checksum of received segmentCheck if computed checksum equals checksum field value

NO - error detectedYES - no error detected But maybe errors nonethelessMore later hellip

22

Checksuming Cyclic Redundancy Check

View data bits D as a binary numberChoose r+1 bit pattern (generator) G Goal choose r CRC bits R such that

ltDRgt exactly divisible by G (modulo 2)Receiver knows G divides ltDRgt by G If non-zero remainder error detectedCan detect all burst errors less than r+1 bits

Widely used in practice (ATM HDLC)

23

CRC Example

WantD2r XOR R = nG

EquivalentlyD2r = nG XOR R

Equivalently if we divide D2r by G

want remainder R

R = remainder[ ]D2r

G

24

Example of G(x) Polynomials

CRC-12X12 + X11 + X3 + X2 + X + 1

CRC-16X16 + X15 + X2 + 1

CRC-CCITTX16 + X15 + X5 + 1

CRC-32X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10

+ X8 + X7 + X5 + X4 + X2 + X + 1

CRCrsquos Are Implemented in Shift registers

25

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

26

Multiple Access Links and Protocols (12)

Two types of ldquolinksrdquoPoint-to-point

PPP for dial-up accessPoint-to-point link between Ethernet switch and host

Broadcast (shared wire or medium)Old-fashioned EthernetUpstream HFC80211 wireless LAN

27

Multiple Access Protocols (22)

Single shared broadcast channel Two or more simultaneous transmissions by nodes interference

Collision if node receives two or more signals at the same time

Multiple access protocolDistributed algorithm that determines how nodes share channel ie determine when node can transmitCommunication about channel sharing must use channel itself

28

Ideal Multiple Access Protocols

Broadcast channel of rate R bps1 When one node wants to transmit it can send at

rate R2 When M nodes want to transmit each can send

at average rate RM3 Fully decentralized

No special node to coordinate transmissionsNo synchronization of clocks slots

4 Simple

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 5: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

9

Link Layer Introduction

Some terminologyhosts and routers are nodescommunication channels that connect adjacent nodes along communication path are linksraquo wired linksraquo wireless linksraquo LANs

layer-2 packet is a frameencapsulates datagram

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

10

Link layer context

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

frame relay on intermediate links 80211 on last link

each link protocol provides different servicesraquo eg may or may not provide

rdt over link

transportation analogytrip from Princeton to Lausanneraquo limo Princeton to JFKraquo plane JFK to Genevaraquo train Geneva to Lausanne

tourist = datagramtransport segment = communication linktransportation mode = link layer protocoltravel agent = routing algorithm

11

Link Layer Services (12)

Framing link accessEncapsulate datagram into frame adding header trailerChannel access if shared mediumldquoMACrdquo addresses used in frame headers to identify source dest

Different from IP address

Reliable delivery between adjacent nodesWe briefly discussed how to do this alreadySeldom used on low bit error link (fiber some twisted pair)Wireless links high error rates

Q why both link-level and end-end reliability

12

Link Layer Services (22)

Flow ControlPacing between adjacent sending and receiving nodes

Error DetectionErrors caused by signal attenuation noiseReceiver detects presence of errors

Signals sender for retransmission or drops frame

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

Half-duplex and full-duplexWith half duplex nodes at both ends of link can transmit but not at same time

13

Where is the link layer implemented

in each and every hostlink layer implemented in ldquoadaptorrdquo (aka network interface card NIC)raquo Ethernet card PCMCI card

80211 cardraquo implements link physical

layer

attaches into hostrsquos system busescombination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

host schematic

applicationtransportnetwork

link

linkphysical

14

Adaptors Communicating

sending sideraquo encapsulates datagram in

frameraquo adds error checking bits

rdt flow control etc

receiving sideraquo looks for errors rdt flow

control etcraquo extracts datagram passes

to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

15

Encoding Information Frames

Typical Fields in a Frame

StartFrame

Delimiter

SourceAddress

DestinationAddress

FrameControl Data Check

sum

16

DLL Operation

NL

DLL

PL

Retransmitif timeout

ACK ifcorrectFrame

CRC

ACKCRC

Sender Receiver

correct and ordered

17

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

18

Error Detection

EDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields

bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction

otherwise

19

Error Detection

Additional bits added by transmitter for error detection code

ParityValue of parity bit is such that character has even (even parity) or odd (odd parity) number of onesEven number of bit errors goes undetectedChecksum can be a simple XOR operation of bits to be checked

DL protocols use more sophisticated methods like Cyclic Redundancy Check (CRC)

20

Parity Checking

Single Bit ParityDetect single bit errors

Two Dimensional Bit ParityDetect and correct single bit errors

0 0

21

Internet Checksum

Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer only)

SenderTreat segment contents as sequence of 16-bit integersChecksum addition (1rsquos complement sum) of segment contentsSender puts checksum value into UDP checksum field

ReceiverCompute checksum of received segmentCheck if computed checksum equals checksum field value

NO - error detectedYES - no error detected But maybe errors nonethelessMore later hellip

22

Checksuming Cyclic Redundancy Check

View data bits D as a binary numberChoose r+1 bit pattern (generator) G Goal choose r CRC bits R such that

ltDRgt exactly divisible by G (modulo 2)Receiver knows G divides ltDRgt by G If non-zero remainder error detectedCan detect all burst errors less than r+1 bits

Widely used in practice (ATM HDLC)

23

CRC Example

WantD2r XOR R = nG

EquivalentlyD2r = nG XOR R

Equivalently if we divide D2r by G

want remainder R

R = remainder[ ]D2r

G

24

Example of G(x) Polynomials

CRC-12X12 + X11 + X3 + X2 + X + 1

CRC-16X16 + X15 + X2 + 1

CRC-CCITTX16 + X15 + X5 + 1

CRC-32X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10

+ X8 + X7 + X5 + X4 + X2 + X + 1

CRCrsquos Are Implemented in Shift registers

25

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

26

Multiple Access Links and Protocols (12)

Two types of ldquolinksrdquoPoint-to-point

PPP for dial-up accessPoint-to-point link between Ethernet switch and host

Broadcast (shared wire or medium)Old-fashioned EthernetUpstream HFC80211 wireless LAN

27

Multiple Access Protocols (22)

Single shared broadcast channel Two or more simultaneous transmissions by nodes interference

Collision if node receives two or more signals at the same time

Multiple access protocolDistributed algorithm that determines how nodes share channel ie determine when node can transmitCommunication about channel sharing must use channel itself

28

Ideal Multiple Access Protocols

Broadcast channel of rate R bps1 When one node wants to transmit it can send at

rate R2 When M nodes want to transmit each can send

at average rate RM3 Fully decentralized

No special node to coordinate transmissionsNo synchronization of clocks slots

4 Simple

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 6: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

11

Link Layer Services (12)

Framing link accessEncapsulate datagram into frame adding header trailerChannel access if shared mediumldquoMACrdquo addresses used in frame headers to identify source dest

Different from IP address

Reliable delivery between adjacent nodesWe briefly discussed how to do this alreadySeldom used on low bit error link (fiber some twisted pair)Wireless links high error rates

Q why both link-level and end-end reliability

12

Link Layer Services (22)

Flow ControlPacing between adjacent sending and receiving nodes

Error DetectionErrors caused by signal attenuation noiseReceiver detects presence of errors

Signals sender for retransmission or drops frame

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

Half-duplex and full-duplexWith half duplex nodes at both ends of link can transmit but not at same time

13

Where is the link layer implemented

in each and every hostlink layer implemented in ldquoadaptorrdquo (aka network interface card NIC)raquo Ethernet card PCMCI card

80211 cardraquo implements link physical

layer

attaches into hostrsquos system busescombination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

host schematic

applicationtransportnetwork

link

linkphysical

14

Adaptors Communicating

sending sideraquo encapsulates datagram in

frameraquo adds error checking bits

rdt flow control etc

receiving sideraquo looks for errors rdt flow

control etcraquo extracts datagram passes

to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

15

Encoding Information Frames

Typical Fields in a Frame

StartFrame

Delimiter

SourceAddress

DestinationAddress

FrameControl Data Check

sum

16

DLL Operation

NL

DLL

PL

Retransmitif timeout

ACK ifcorrectFrame

CRC

ACKCRC

Sender Receiver

correct and ordered

17

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

18

Error Detection

EDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields

bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction

otherwise

19

Error Detection

Additional bits added by transmitter for error detection code

ParityValue of parity bit is such that character has even (even parity) or odd (odd parity) number of onesEven number of bit errors goes undetectedChecksum can be a simple XOR operation of bits to be checked

DL protocols use more sophisticated methods like Cyclic Redundancy Check (CRC)

20

Parity Checking

Single Bit ParityDetect single bit errors

Two Dimensional Bit ParityDetect and correct single bit errors

0 0

21

Internet Checksum

Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer only)

SenderTreat segment contents as sequence of 16-bit integersChecksum addition (1rsquos complement sum) of segment contentsSender puts checksum value into UDP checksum field

ReceiverCompute checksum of received segmentCheck if computed checksum equals checksum field value

NO - error detectedYES - no error detected But maybe errors nonethelessMore later hellip

22

Checksuming Cyclic Redundancy Check

View data bits D as a binary numberChoose r+1 bit pattern (generator) G Goal choose r CRC bits R such that

ltDRgt exactly divisible by G (modulo 2)Receiver knows G divides ltDRgt by G If non-zero remainder error detectedCan detect all burst errors less than r+1 bits

Widely used in practice (ATM HDLC)

23

CRC Example

WantD2r XOR R = nG

EquivalentlyD2r = nG XOR R

Equivalently if we divide D2r by G

want remainder R

R = remainder[ ]D2r

G

24

Example of G(x) Polynomials

CRC-12X12 + X11 + X3 + X2 + X + 1

CRC-16X16 + X15 + X2 + 1

CRC-CCITTX16 + X15 + X5 + 1

CRC-32X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10

+ X8 + X7 + X5 + X4 + X2 + X + 1

CRCrsquos Are Implemented in Shift registers

25

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

26

Multiple Access Links and Protocols (12)

Two types of ldquolinksrdquoPoint-to-point

PPP for dial-up accessPoint-to-point link between Ethernet switch and host

Broadcast (shared wire or medium)Old-fashioned EthernetUpstream HFC80211 wireless LAN

27

Multiple Access Protocols (22)

Single shared broadcast channel Two or more simultaneous transmissions by nodes interference

Collision if node receives two or more signals at the same time

Multiple access protocolDistributed algorithm that determines how nodes share channel ie determine when node can transmitCommunication about channel sharing must use channel itself

28

Ideal Multiple Access Protocols

Broadcast channel of rate R bps1 When one node wants to transmit it can send at

rate R2 When M nodes want to transmit each can send

at average rate RM3 Fully decentralized

No special node to coordinate transmissionsNo synchronization of clocks slots

4 Simple

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 7: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

13

Where is the link layer implemented

in each and every hostlink layer implemented in ldquoadaptorrdquo (aka network interface card NIC)raquo Ethernet card PCMCI card

80211 cardraquo implements link physical

layer

attaches into hostrsquos system busescombination of hardware software firmware

controller

physicaltransmission

cpu memory

host bus (eg PCI)

network adaptercard

host schematic

applicationtransportnetwork

link

linkphysical

14

Adaptors Communicating

sending sideraquo encapsulates datagram in

frameraquo adds error checking bits

rdt flow control etc

receiving sideraquo looks for errors rdt flow

control etcraquo extracts datagram passes

to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

15

Encoding Information Frames

Typical Fields in a Frame

StartFrame

Delimiter

SourceAddress

DestinationAddress

FrameControl Data Check

sum

16

DLL Operation

NL

DLL

PL

Retransmitif timeout

ACK ifcorrectFrame

CRC

ACKCRC

Sender Receiver

correct and ordered

17

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

18

Error Detection

EDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields

bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction

otherwise

19

Error Detection

Additional bits added by transmitter for error detection code

ParityValue of parity bit is such that character has even (even parity) or odd (odd parity) number of onesEven number of bit errors goes undetectedChecksum can be a simple XOR operation of bits to be checked

DL protocols use more sophisticated methods like Cyclic Redundancy Check (CRC)

20

Parity Checking

Single Bit ParityDetect single bit errors

Two Dimensional Bit ParityDetect and correct single bit errors

0 0

21

Internet Checksum

Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer only)

SenderTreat segment contents as sequence of 16-bit integersChecksum addition (1rsquos complement sum) of segment contentsSender puts checksum value into UDP checksum field

ReceiverCompute checksum of received segmentCheck if computed checksum equals checksum field value

NO - error detectedYES - no error detected But maybe errors nonethelessMore later hellip

22

Checksuming Cyclic Redundancy Check

View data bits D as a binary numberChoose r+1 bit pattern (generator) G Goal choose r CRC bits R such that

ltDRgt exactly divisible by G (modulo 2)Receiver knows G divides ltDRgt by G If non-zero remainder error detectedCan detect all burst errors less than r+1 bits

Widely used in practice (ATM HDLC)

23

CRC Example

WantD2r XOR R = nG

EquivalentlyD2r = nG XOR R

Equivalently if we divide D2r by G

want remainder R

R = remainder[ ]D2r

G

24

Example of G(x) Polynomials

CRC-12X12 + X11 + X3 + X2 + X + 1

CRC-16X16 + X15 + X2 + 1

CRC-CCITTX16 + X15 + X5 + 1

CRC-32X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10

+ X8 + X7 + X5 + X4 + X2 + X + 1

CRCrsquos Are Implemented in Shift registers

25

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

26

Multiple Access Links and Protocols (12)

Two types of ldquolinksrdquoPoint-to-point

PPP for dial-up accessPoint-to-point link between Ethernet switch and host

Broadcast (shared wire or medium)Old-fashioned EthernetUpstream HFC80211 wireless LAN

27

Multiple Access Protocols (22)

Single shared broadcast channel Two or more simultaneous transmissions by nodes interference

Collision if node receives two or more signals at the same time

Multiple access protocolDistributed algorithm that determines how nodes share channel ie determine when node can transmitCommunication about channel sharing must use channel itself

28

Ideal Multiple Access Protocols

Broadcast channel of rate R bps1 When one node wants to transmit it can send at

rate R2 When M nodes want to transmit each can send

at average rate RM3 Fully decentralized

No special node to coordinate transmissionsNo synchronization of clocks slots

4 Simple

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 8: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

15

Encoding Information Frames

Typical Fields in a Frame

StartFrame

Delimiter

SourceAddress

DestinationAddress

FrameControl Data Check

sum

16

DLL Operation

NL

DLL

PL

Retransmitif timeout

ACK ifcorrectFrame

CRC

ACKCRC

Sender Receiver

correct and ordered

17

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

18

Error Detection

EDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields

bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction

otherwise

19

Error Detection

Additional bits added by transmitter for error detection code

ParityValue of parity bit is such that character has even (even parity) or odd (odd parity) number of onesEven number of bit errors goes undetectedChecksum can be a simple XOR operation of bits to be checked

DL protocols use more sophisticated methods like Cyclic Redundancy Check (CRC)

20

Parity Checking

Single Bit ParityDetect single bit errors

Two Dimensional Bit ParityDetect and correct single bit errors

0 0

21

Internet Checksum

Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer only)

SenderTreat segment contents as sequence of 16-bit integersChecksum addition (1rsquos complement sum) of segment contentsSender puts checksum value into UDP checksum field

ReceiverCompute checksum of received segmentCheck if computed checksum equals checksum field value

NO - error detectedYES - no error detected But maybe errors nonethelessMore later hellip

22

Checksuming Cyclic Redundancy Check

View data bits D as a binary numberChoose r+1 bit pattern (generator) G Goal choose r CRC bits R such that

ltDRgt exactly divisible by G (modulo 2)Receiver knows G divides ltDRgt by G If non-zero remainder error detectedCan detect all burst errors less than r+1 bits

Widely used in practice (ATM HDLC)

23

CRC Example

WantD2r XOR R = nG

EquivalentlyD2r = nG XOR R

Equivalently if we divide D2r by G

want remainder R

R = remainder[ ]D2r

G

24

Example of G(x) Polynomials

CRC-12X12 + X11 + X3 + X2 + X + 1

CRC-16X16 + X15 + X2 + 1

CRC-CCITTX16 + X15 + X5 + 1

CRC-32X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10

+ X8 + X7 + X5 + X4 + X2 + X + 1

CRCrsquos Are Implemented in Shift registers

25

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

26

Multiple Access Links and Protocols (12)

Two types of ldquolinksrdquoPoint-to-point

PPP for dial-up accessPoint-to-point link between Ethernet switch and host

Broadcast (shared wire or medium)Old-fashioned EthernetUpstream HFC80211 wireless LAN

27

Multiple Access Protocols (22)

Single shared broadcast channel Two or more simultaneous transmissions by nodes interference

Collision if node receives two or more signals at the same time

Multiple access protocolDistributed algorithm that determines how nodes share channel ie determine when node can transmitCommunication about channel sharing must use channel itself

28

Ideal Multiple Access Protocols

Broadcast channel of rate R bps1 When one node wants to transmit it can send at

rate R2 When M nodes want to transmit each can send

at average rate RM3 Fully decentralized

No special node to coordinate transmissionsNo synchronization of clocks slots

4 Simple

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 9: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

17

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

18

Error Detection

EDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields

bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction

otherwise

19

Error Detection

Additional bits added by transmitter for error detection code

ParityValue of parity bit is such that character has even (even parity) or odd (odd parity) number of onesEven number of bit errors goes undetectedChecksum can be a simple XOR operation of bits to be checked

DL protocols use more sophisticated methods like Cyclic Redundancy Check (CRC)

20

Parity Checking

Single Bit ParityDetect single bit errors

Two Dimensional Bit ParityDetect and correct single bit errors

0 0

21

Internet Checksum

Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer only)

SenderTreat segment contents as sequence of 16-bit integersChecksum addition (1rsquos complement sum) of segment contentsSender puts checksum value into UDP checksum field

ReceiverCompute checksum of received segmentCheck if computed checksum equals checksum field value

NO - error detectedYES - no error detected But maybe errors nonethelessMore later hellip

22

Checksuming Cyclic Redundancy Check

View data bits D as a binary numberChoose r+1 bit pattern (generator) G Goal choose r CRC bits R such that

ltDRgt exactly divisible by G (modulo 2)Receiver knows G divides ltDRgt by G If non-zero remainder error detectedCan detect all burst errors less than r+1 bits

Widely used in practice (ATM HDLC)

23

CRC Example

WantD2r XOR R = nG

EquivalentlyD2r = nG XOR R

Equivalently if we divide D2r by G

want remainder R

R = remainder[ ]D2r

G

24

Example of G(x) Polynomials

CRC-12X12 + X11 + X3 + X2 + X + 1

CRC-16X16 + X15 + X2 + 1

CRC-CCITTX16 + X15 + X5 + 1

CRC-32X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10

+ X8 + X7 + X5 + X4 + X2 + X + 1

CRCrsquos Are Implemented in Shift registers

25

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

26

Multiple Access Links and Protocols (12)

Two types of ldquolinksrdquoPoint-to-point

PPP for dial-up accessPoint-to-point link between Ethernet switch and host

Broadcast (shared wire or medium)Old-fashioned EthernetUpstream HFC80211 wireless LAN

27

Multiple Access Protocols (22)

Single shared broadcast channel Two or more simultaneous transmissions by nodes interference

Collision if node receives two or more signals at the same time

Multiple access protocolDistributed algorithm that determines how nodes share channel ie determine when node can transmitCommunication about channel sharing must use channel itself

28

Ideal Multiple Access Protocols

Broadcast channel of rate R bps1 When one node wants to transmit it can send at

rate R2 When M nodes want to transmit each can send

at average rate RM3 Fully decentralized

No special node to coordinate transmissionsNo synchronization of clocks slots

4 Simple

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 10: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

19

Error Detection

Additional bits added by transmitter for error detection code

ParityValue of parity bit is such that character has even (even parity) or odd (odd parity) number of onesEven number of bit errors goes undetectedChecksum can be a simple XOR operation of bits to be checked

DL protocols use more sophisticated methods like Cyclic Redundancy Check (CRC)

20

Parity Checking

Single Bit ParityDetect single bit errors

Two Dimensional Bit ParityDetect and correct single bit errors

0 0

21

Internet Checksum

Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer only)

SenderTreat segment contents as sequence of 16-bit integersChecksum addition (1rsquos complement sum) of segment contentsSender puts checksum value into UDP checksum field

ReceiverCompute checksum of received segmentCheck if computed checksum equals checksum field value

NO - error detectedYES - no error detected But maybe errors nonethelessMore later hellip

22

Checksuming Cyclic Redundancy Check

View data bits D as a binary numberChoose r+1 bit pattern (generator) G Goal choose r CRC bits R such that

ltDRgt exactly divisible by G (modulo 2)Receiver knows G divides ltDRgt by G If non-zero remainder error detectedCan detect all burst errors less than r+1 bits

Widely used in practice (ATM HDLC)

23

CRC Example

WantD2r XOR R = nG

EquivalentlyD2r = nG XOR R

Equivalently if we divide D2r by G

want remainder R

R = remainder[ ]D2r

G

24

Example of G(x) Polynomials

CRC-12X12 + X11 + X3 + X2 + X + 1

CRC-16X16 + X15 + X2 + 1

CRC-CCITTX16 + X15 + X5 + 1

CRC-32X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10

+ X8 + X7 + X5 + X4 + X2 + X + 1

CRCrsquos Are Implemented in Shift registers

25

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

26

Multiple Access Links and Protocols (12)

Two types of ldquolinksrdquoPoint-to-point

PPP for dial-up accessPoint-to-point link between Ethernet switch and host

Broadcast (shared wire or medium)Old-fashioned EthernetUpstream HFC80211 wireless LAN

27

Multiple Access Protocols (22)

Single shared broadcast channel Two or more simultaneous transmissions by nodes interference

Collision if node receives two or more signals at the same time

Multiple access protocolDistributed algorithm that determines how nodes share channel ie determine when node can transmitCommunication about channel sharing must use channel itself

28

Ideal Multiple Access Protocols

Broadcast channel of rate R bps1 When one node wants to transmit it can send at

rate R2 When M nodes want to transmit each can send

at average rate RM3 Fully decentralized

No special node to coordinate transmissionsNo synchronization of clocks slots

4 Simple

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 11: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

21

Internet Checksum

Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer only)

SenderTreat segment contents as sequence of 16-bit integersChecksum addition (1rsquos complement sum) of segment contentsSender puts checksum value into UDP checksum field

ReceiverCompute checksum of received segmentCheck if computed checksum equals checksum field value

NO - error detectedYES - no error detected But maybe errors nonethelessMore later hellip

22

Checksuming Cyclic Redundancy Check

View data bits D as a binary numberChoose r+1 bit pattern (generator) G Goal choose r CRC bits R such that

ltDRgt exactly divisible by G (modulo 2)Receiver knows G divides ltDRgt by G If non-zero remainder error detectedCan detect all burst errors less than r+1 bits

Widely used in practice (ATM HDLC)

23

CRC Example

WantD2r XOR R = nG

EquivalentlyD2r = nG XOR R

Equivalently if we divide D2r by G

want remainder R

R = remainder[ ]D2r

G

24

Example of G(x) Polynomials

CRC-12X12 + X11 + X3 + X2 + X + 1

CRC-16X16 + X15 + X2 + 1

CRC-CCITTX16 + X15 + X5 + 1

CRC-32X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10

+ X8 + X7 + X5 + X4 + X2 + X + 1

CRCrsquos Are Implemented in Shift registers

25

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

26

Multiple Access Links and Protocols (12)

Two types of ldquolinksrdquoPoint-to-point

PPP for dial-up accessPoint-to-point link between Ethernet switch and host

Broadcast (shared wire or medium)Old-fashioned EthernetUpstream HFC80211 wireless LAN

27

Multiple Access Protocols (22)

Single shared broadcast channel Two or more simultaneous transmissions by nodes interference

Collision if node receives two or more signals at the same time

Multiple access protocolDistributed algorithm that determines how nodes share channel ie determine when node can transmitCommunication about channel sharing must use channel itself

28

Ideal Multiple Access Protocols

Broadcast channel of rate R bps1 When one node wants to transmit it can send at

rate R2 When M nodes want to transmit each can send

at average rate RM3 Fully decentralized

No special node to coordinate transmissionsNo synchronization of clocks slots

4 Simple

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 12: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

23

CRC Example

WantD2r XOR R = nG

EquivalentlyD2r = nG XOR R

Equivalently if we divide D2r by G

want remainder R

R = remainder[ ]D2r

G

24

Example of G(x) Polynomials

CRC-12X12 + X11 + X3 + X2 + X + 1

CRC-16X16 + X15 + X2 + 1

CRC-CCITTX16 + X15 + X5 + 1

CRC-32X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10

+ X8 + X7 + X5 + X4 + X2 + X + 1

CRCrsquos Are Implemented in Shift registers

25

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

26

Multiple Access Links and Protocols (12)

Two types of ldquolinksrdquoPoint-to-point

PPP for dial-up accessPoint-to-point link between Ethernet switch and host

Broadcast (shared wire or medium)Old-fashioned EthernetUpstream HFC80211 wireless LAN

27

Multiple Access Protocols (22)

Single shared broadcast channel Two or more simultaneous transmissions by nodes interference

Collision if node receives two or more signals at the same time

Multiple access protocolDistributed algorithm that determines how nodes share channel ie determine when node can transmitCommunication about channel sharing must use channel itself

28

Ideal Multiple Access Protocols

Broadcast channel of rate R bps1 When one node wants to transmit it can send at

rate R2 When M nodes want to transmit each can send

at average rate RM3 Fully decentralized

No special node to coordinate transmissionsNo synchronization of clocks slots

4 Simple

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 13: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

25

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

26

Multiple Access Links and Protocols (12)

Two types of ldquolinksrdquoPoint-to-point

PPP for dial-up accessPoint-to-point link between Ethernet switch and host

Broadcast (shared wire or medium)Old-fashioned EthernetUpstream HFC80211 wireless LAN

27

Multiple Access Protocols (22)

Single shared broadcast channel Two or more simultaneous transmissions by nodes interference

Collision if node receives two or more signals at the same time

Multiple access protocolDistributed algorithm that determines how nodes share channel ie determine when node can transmitCommunication about channel sharing must use channel itself

28

Ideal Multiple Access Protocols

Broadcast channel of rate R bps1 When one node wants to transmit it can send at

rate R2 When M nodes want to transmit each can send

at average rate RM3 Fully decentralized

No special node to coordinate transmissionsNo synchronization of clocks slots

4 Simple

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 14: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

27

Multiple Access Protocols (22)

Single shared broadcast channel Two or more simultaneous transmissions by nodes interference

Collision if node receives two or more signals at the same time

Multiple access protocolDistributed algorithm that determines how nodes share channel ie determine when node can transmitCommunication about channel sharing must use channel itself

28

Ideal Multiple Access Protocols

Broadcast channel of rate R bps1 When one node wants to transmit it can send at

rate R2 When M nodes want to transmit each can send

at average rate RM3 Fully decentralized

No special node to coordinate transmissionsNo synchronization of clocks slots

4 Simple

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 15: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

29

MAC Protocols A Taxonomy

Three broad classesChannel Partitioning

Divide channel into smaller ldquopiecesrdquo (time slots frequency code)Allocate piece to node for exclusive use

Random AccessChannel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquoNodes take turns but nodes with more to send can take longer turns

30

Channel Partitioning MAC Protocols TDMA

TDMA time division multiple accessAccess to channel in roundsldquoEach station gets fixed length slot (length = pkttrans time) in each round Unused slots go idleExample 6-station LAN 134 have pkt slots 256 idle

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 16: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

31

Channel Partitioning MAC Protocols FDMA

FDMA frequency division multiple accessChannel spectrum divided into frequency bandsEach station assigned fixed frequency bandUnused transmission time in frequency bands go idle Example 6-station LAN 134 have pkt frequency bands 256 idle

freq

uenc

y ba

nds

time

32

Random Access Protocols

When node has packet to sendTransmit at full channel data rate RNo a priori coordination among nodes

Two or more transmitting nodes ldquocollisionrdquoRandom access MAC protocol specifies

How to detect collisionsHow to recover from collisions (eg via delayed retransmissions)

Examples of random access MAC protocolsSlotted ALOHAALOHACSMA CSMACD CSMACA

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 17: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

33

Slotted ALOHA (12)

AssumptionsAll frames same sizeTime is divided into equal size slots time to transmit 1 frameNodes start to transmit frames only at beginning of slotsNodes are synchronizedIf 2 or more nodes transmit in slot all nodes detect collision

OperationWhen node obtains fresh frame it transmits in next slotNo collision node can send new frame in next slotif collision node retransmits frame in each subsequent slot with prob p until success

34

Slotted ALOHA (22)

ProsSingle active node can continuously transmit at full rate of channelHighly decentralized only slots in nodes need to be in syncSimple

ConsCollisions wasting slotsIdle slotsNodes may be able to detect collision in less than time to transmit packetClock synchronization

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 18: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

35

Slotted ALOHA Efficiency

Suppose N nodes with many frames to send each transmits in slot with probability pProb that node 1 has success in a slot = p(1-p)N-1

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

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

For many nodes take limit of Np(1-p)N-1 as N goes to infinity gives 1e = 37

Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send

At best channelused for useful transmissions 37of time

36

Pure (Unslotted) ALOHA

Unslotted Aloha simpler no synchronizationWhen frame first arrives

Transmit immediately Collision probability increases

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

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 19: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

37

Pure ALOHA Efficiency

P(success by given node) = P(node transmits) P(no other node transmits in [p0-1p0] P(no other node transmits in [p0-1p0]

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

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

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18 Even worse

38

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame

If channel sensed busy defer transmission

Human analogy donrsquot interrupt others

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

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

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

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

Frame sent to Arsquos MAC address (unicast)

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

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

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

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

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

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

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

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

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

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

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

66

Ethernet CSMACD Algorithm (22)

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

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

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

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

transparentraquo hosts are unaware of presence of switches

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

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

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

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

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

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

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

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

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

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

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

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

DHCP client receives DHCP ACK reply

112

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

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

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

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

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

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

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

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

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

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

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 20: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

39

CSMA Collisions

Collisions can still occurPropagation delay means two nodes may not hear each otherrsquos transmission

CollisionEntire packet transmission time wasted

NoteRole of distance amp propagation delay in determining collision probability

spatial layout of nodes

40

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMACollisions detected within short timeColliding transmissions aborted reducing channel

wastage

Collision detectionEasy in wired LANs measure signal strengths compare transmitted received signalsDifficult in wireless LANs receiver shut off while transmitting

Human analogy the polite conversationalist

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

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

= adapter

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

58-23-D7-FA-20-B0

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

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

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

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

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

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

Question how to determineMAC address of B knowing Brsquos IP address

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

58-23-D7-FA-20-B0

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

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

B receives ARP packet replies to A with its (Bs) MAC address

Frame sent to Arsquos MAC address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out)

Soft state information that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

66

Ethernet CSMACD Algorithm (22)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 21: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

41

CSMACD Collision Detection

42

ldquoTaking Turnsrdquo MAC Protocols (12)

Channel partitioning MAC protocolsShare channel efficiently and fairly at high loadInefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node

Random access MAC protocolsEfficient at low load single node can fully utilize channelHigh load collision overhead

ldquoTaking turnsrdquo protocolsLook for best of both worlds

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

MAC flat address portability Can move LAN card from one LAN to another

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineMAC address of B knowing Brsquos IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

B receives ARP packet replies to A with its (Bs) MAC address

Frame sent to Arsquos MAC address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out)

Soft state information that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

66

Ethernet CSMACD Algorithm (22)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 22: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

43

ldquoTaking Turnsrdquo MAC protocols

Pollingmaster node ldquoinvitesrdquoslave nodes to transmit in turntypically used with ldquodumbrdquo slave devicesconcernsraquo polling overhead raquo latencyraquo single point of failure

(master)

master

slaves

poll

data

data

44

ldquoTaking Turnsrdquo MAC protocols

Token passingcontrol token passed from one node to next sequentiallytoken messageconcernsraquo token overhead raquo latencyraquo single point of failure

(token)

T

data

(nothingto send)

T

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

MAC flat address portability Can move LAN card from one LAN to another

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineMAC address of B knowing Brsquos IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

B receives ARP packet replies to A with its (Bs) MAC address

Frame sent to Arsquos MAC address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out)

Soft state information that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

66

Ethernet CSMACD Algorithm (22)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 23: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

45

Summary of MAC Protocols

What do you do with a shared mediaChannel Partitioning by time frequency or code

Time Division Frequency Division

Random partitioning (dynamic)ALOHA S-ALOHA CSMA CSMACDCarrier sensing easy in some technologies (wire) hard in others (wireless)CSMACD used in EthernetCSMACA used in 80211

Taking TurnsPolling from a central site token passing

46

LAN Technologies

Data link layer so farServices error detectioncorrection multiple access

Next LAN technologiesAddressingEthernet

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

MAC flat address portability Can move LAN card from one LAN to another

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineMAC address of B knowing Brsquos IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

B receives ARP packet replies to A with its (Bs) MAC address

Frame sent to Arsquos MAC address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out)

Soft state information that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

66

Ethernet CSMACD Algorithm (22)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 24: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

47

Error Detection and Correction

Data Link Control - Roadmap

Introduction and Services

22 Data Link ControlData Link Control

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

48

MAC Addresses and ARP

32-bit IP addressnetwork-layer addressUsed to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet) addressUsed to get frame from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

MAC flat address portability Can move LAN card from one LAN to another

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineMAC address of B knowing Brsquos IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

B receives ARP packet replies to A with its (Bs) MAC address

Frame sent to Arsquos MAC address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out)

Soft state information that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

66

Ethernet CSMACD Algorithm (22)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 25: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

49

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

50

LAN Address

MAC address allocation administered by IEEEManufacturer buys portion of MAC address space (to assure uniqueness)Analogy(a) MAC address like Social Security Number(b) IP address like postal address

MAC flat address portability Can move LAN card from one LAN to another

IP hierarchical address NOT portableDepends on IP subnet to which node is attached

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineMAC address of B knowing Brsquos IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

B receives ARP packet replies to A with its (Bs) MAC address

Frame sent to Arsquos MAC address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out)

Soft state information that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

66

Ethernet CSMACD Algorithm (22)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 26: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

51

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP tableARP Table IPMAC address mappings for some LAN

nodeslt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineMAC address of B knowing Brsquos IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

52

ARP Protocol Same LAN (Network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP tableA broadcasts ARP query packet containing Bs IP address

Dest MAC address = FF-FF-FF-FF-FF-FFAll machines on LAN receive

ARP query

B receives ARP packet replies to A with its (Bs) MAC address

Frame sent to Arsquos MAC address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out)

Soft state information that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquoNodes create their ARP tables

without intervention from net

administrator

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

66

Ethernet CSMACD Algorithm (22)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 27: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

53

Routing to Another LAN (12)

Two ARP tables in router R one for each IP network (LAN)In routing table at source Host find router 111111111110In ARP table at source find MAC address E6-E9-00-17-BB-4B etc

walkthrough send datagram from A to B via R assume A knowrsquos B IP address

54

A creates datagram with source A destination BA uses ARP to get Rrsquos MAC address for 111111111110A creates link-layer frame with Rs MAC address as dest frame contains A-to-B IP datagramArsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its destined to BR uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to B

Routing to Another LAN (22)

This is a really importantexample ndash make sure youunderstand

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

66

Ethernet CSMACD Algorithm (22)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 28: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

55

DHCP Dynamic Host Configuration Protocol

Goal allow host to dynamically obtain its IPaddress from network server when it joins network

Can renew its lease on address in useAllows reuse of addresses (only hold address while connected an ldquoonrdquoSupport for mobile users who want to join network (more shortly)

DHCP overviewHost broadcasts ldquoDHCP discoverrdquo msgDHCP server responds with ldquoDHCP offerrdquo msgHost requests IP address ldquoDHCP requestrdquo msgDHCP server sends address ldquoDHCP ackrdquo msg

56

DHCP Client-Server Scenario (12)

223111

223112

223113

223114 223129

223122

223121

223132223131

2231327

A

B

E

DHCP

server

arriving DHCP client needsaddress in thisnetwork

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

66

Ethernet CSMACD Algorithm (22)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 29: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

57

DHCP Client-Server Scenario (22)

DHCP server 223125 arrivingclient

time

DHCP discover

src 0000 68 dest 25525525525567yiaddr 0000transaction ID 654

DHCP offersrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 654Lifetime 3600 secs

DHCP request

src 0000 68 dest 255255255255 67yiaddrr 223124transaction ID 655Lifetime 3600 secs

DHCP ACKsrc 223125 67 dest 255255255255 68yiaddrr 223124transaction ID 655Lifetime 3600 secs

58

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

66

Ethernet CSMACD Algorithm (22)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 30: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

59

Ethernet

ldquoDominantrdquo wired LAN technologyCheap $20 for 100MbsFirst widely used LAN technologySimpler cheaper than token LANs and ATMKept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

60

Star Topology

Bus topology popular through mid 90sNow star topology prevailsConnection choices hub or switch (will not cover this)

hub orswitch

61

Ethernet Frame Structure (12)

Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

66

Ethernet CSMACD Algorithm (22)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 31: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

61

Ethernet Frame Structure (12)

Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Preamble7 bytes with pattern 10101010 followed by one byte with pattern 10101011Used to synchronize receiver sender clock rates

62

Ethernet Frame Structure (22)

Addresses 6 bytesIf adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocolOtherwise adapter discards frame

Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC checked at receiver if error is detected the frame is simply dropped

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

66

Ethernet CSMACD Algorithm (22)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 32: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

63

Unreliable Connectionless Service

Connectionless No handshaking between sending and receiving adapterUnreliable receiving adapter doesnrsquot send acksor nacks to sending adapter

Stream of datagrams passed to network layer can have gapsGaps will be filled if app is using TCPOtherwise app will see the gaps

64

Ethernet Uses CSMACD

No slotsAdapter doesnrsquot transmit if it senses that some other adapter is transmitting that is carrier senseTransmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

66

Ethernet CSMACD Algorithm (22)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 33: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

65

Ethernet CSMACD Algorithm (12)

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

66

Ethernet CSMACD Algorithm (22)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential BackoffGoal adapt retransmission attempts to estimated current load

heavy load random wait will be longer

First collision choose K from 01 delay is K 512 bit transmission timesAfter second collision choose K from 0123hellipAfter ten collisions choose K from 01234hellip1023

Seeinteract with Javaapplet on textbook companion Web sitehighly recommended

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 34: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

67

CSMACD Efficiency

Tprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA but still decentralized simple and cheap

transtpropt 51

1efficiency

+=

68

8023 Ethernet Standards Link amp Physical Layers

many different Ethernet standardsraquo common MAC protocol and frame formatraquo different speeds 2 Mbps 10 Mbps 100 Mbps

1Gbps 10G bpsraquo 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

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 35: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

69

Manchester encoding

used in 10BaseTeach bit has a transitionallows clocks in sending and receiving nodes to synchronize to each otherraquo no need for a centralized global clock among nodes

Hey this is physical-layer stuff

70

Error Detection and Correction

Data Control Link - Roadmap

Introduction and Services

22 Data Control LinkData Control Link

Multiple Access Protocols

Link Layer Addressing

Ethernet

Additional Topics

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 36: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

71

Link Layer

Introduction and servicesError detection and

correction Multiple access

protocolsLink-layer

AddressingEthernet

Link-layer switches LANs VLANsPPPLink virtualization

MPLSA day in the life of a

web request

72

Hubs

hellip physical-layer (ldquodumbrdquo) repeatersraquo bits coming in one link go out to all other

links at same rateraquo all nodes connected to hub can collide with

one anotherraquo no frame bufferingraquo no CSMACD at hub host NICs detect

collisions twisted pair

hub

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 37: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

73

Switch

link-layer device smarter than hubs take active roleraquo store forward Ethernet framesraquo examine incoming framersquos MAC address selectively

forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment

transparentraquo hosts are unaware of presence of switches

plug-and-play self-learningraquo switches do not need to be configured

74

Switch allows multiple simultaneous transmissions

hosts have dedicated direct connection to switchswitches buffer packetsEthernet protocol used on each incoming link but no collisions full duplexraquo each link is its own collision

domainswitching A-to-Arsquo and B-to-Brsquosimultaneously without collisions raquo not possible with dumb hub

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 345

6

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 38: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

75

Switch Table

Q how does switch know that Arsquo reachable via interface 4 Brsquoreachable via interface 5A each switch has a switch table each entryraquo (MAC address of host interface to

reach host time stamp)

looks like a routing tableQ how are entries created maintained in switch table raquo something like a routing protocol

A

Arsquo

B

Brsquo

C

Crsquo

switch with six interfaces(123456)

1 2 3

45

6

76

Switch self-learning

switch learns which hosts can be reached through which interfacesraquo when frame received switch

ldquolearnsrdquo location of sender incoming LAN segment

raquo records senderlocation pair in switch table

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 39: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

77

Switch frame filteringforwarding

When frame received

1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination

then if dest on segment from which frame arrived

then drop the frameelse forward the frame on interface

indicated

else flood

forward on all but the interface on which the frame arrived

78

Self-learning forwarding example

A

Arsquo

B

Brsquo

C

Crsquo

1 2 345

6

A Arsquo

Source ADest Arsquo

MAC addr interface TTLSwitch table

(initially empty)A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquoframe destination unknownflood

Arsquo A

destination A location known

Arsquo 4 60

selective send

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 40: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

79

Interconnecting switches

switches can be connected together

A

B

Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3A self learning (works exactly the same as in single-switch case)

S1

C D

E

FS2

S4

S3

HI

G

80

Self-learning multi-switch example

Suppose C sends frame to I I responds to C

Q show switch tables and packet forwarding in S1 S2 S3 S4

A

B

S1

C D

E

FS2

S4

S3

HI

G

12

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 41: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

81

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

82

Switches vs Routers

both store-and-forward devicesraquo routers network layer devices (examine network

layer headers)raquo switches are link layer devices

routers maintain routing tables implement routing algorithmsswitches maintain switch tables implement filtering learning algorithms

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 42: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

83

VLANs motivation

What happens ifCS user moves office to EE but wants connect to CS switchsingle broadcast domainraquo all layer-2 broadcast traffic

(ARP DHCP) crosses entire LAN (securityprivacy efficiency issues)

each lowest level switch has only few ports in use

Computer Science Electrical

EngineeringComputerEngineering

Whatrsquos wrong with this picture

84

VLANsPort-based VLAN switch ports grouped

(by switch management software) so that single physical switch helliphellip

Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

Virtual Local Area Network

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

Electrical Engineering(VLAN ports 1-8)

hellip

1

82

7 9

1610

15

hellip

Computer Science(VLAN ports 9-16)

hellip operates as multiple virtual switches

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 43: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

85

Port-based VLAN

1

8

9

16102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

traffic isolation frames tofrom ports 1-8 can onlyreach ports 1-8raquo can also define VLAN based on

MAC addresses of endpoints rather than switch port

dynamic membershipports can be dynamically assigned among VLANs

router

forwarding between VLANSdone via routing (just as with separate switches)raquo in practice vendors sell combined

switches plus routers

86

VLANS spanning multiple switches

trunk port carries frames between VLANS defined over multiple physical switchesraquo frames forwarded within VLAN between switches canrsquot

be vanilla 8021 frames (must carry VLAN ID info)raquo 8021q protocol addsremoved additional header fields

for frames forwarded between trunk ports

1

8

9

102

7

hellip

Electrical Engineering(VLAN ports 1-8)

Computer Science(VLAN ports 9-15)

15

hellip

2

73

Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN

5

4 6 816

1

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 44: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

87

Type

2-byte Tag Protocol Identifier(value 81-00)

Tag Control Information (12 bit VLAN ID field 3 bit priority field like IP TOS)

Recomputed CRC

8021Q VLAN frame format

8021 frame

8021Q frame

88

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 45: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

89

Point to Point Data Link Control

one sender one receiver one link easier than broadcast linkraquo no Media Access Controlraquo no need for explicit MAC addressingraquo eg dialup link ISDN line

popular point-to-point DLC protocolsraquo PPP (point-to-point protocol)raquo HDLC High level data link control (Data

link used to be considered ldquohigh layerrdquo in protocol stack

90

PPP Design Requirements [RFC 1557]

packet framing encapsulation of network-layer datagram in data link frame raquo carry network layer data of any network layer

protocol (not just IP) at same timeraquo ability to demultiplex upwards

bit transparency must carry any bit pattern in the data fielderror detection (no correction)connection liveness detect signal link failure to network layernetwork layer address negotiation endpoint can learnconfigure each otherrsquos network address

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 46: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

91

PPP non-requirements

no error correctionrecoveryno flow controlout of order delivery OK no need to support multipoint links (eg polling)

Error recovery flow control data re-ordering all relegated to higher layers

92

PPP Data Frame

Flag delimiter (framing)Address does nothing (only one option)Control does nothing in the future possible multiple control fieldsProtocol upper layer protocol to which frame delivered (eg PPP-LCP IP IPCP etc)

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 47: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

93

PPP Data Frame

info upper layer data being carriedcheck cyclic redundancy check for error detection

94

Byte Stuffing

ldquodata transparencyrdquo requirement data field must be allowed to include flag pattern lt01111110gtraquo Q is received lt01111110gt data or flag

Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byteReceiverraquo two 01111110 bytes in a row discard first byte

continue data receptionraquo single 01111110 flag byte

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 48: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

95

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

96

PPP Data Control Protocol

Before exchanging network-layer data data link peers mustconfigure PPP link (max frame length authentication)learnconfigure networklayer informationraquo for IP carry IP Control

Protocol (IPCP) msgs (protocol field 8021) to configurelearn IP address

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 49: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

97

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

98

Virtualization of networks

Virtualization of resources powerful abstraction in systems engineeringcomputing examples virtual memory virtual devicesraquo Virtual machines eg javaraquo IBM VM os from 1960rsquos70rsquos

layering of abstractions donrsquot sweat the details of the lower layer only deal with lower layers abstractly

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 50: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

99

The Internet virtualizing networks

1974 multiple unconnected nets raquo ARPAnetraquo data-over-cable networksraquo packet satellite network (Aloha)raquo packet radio network

hellip differing inraquo addressing conventionsraquo packet formatsraquo error recoveryraquo routing

ARPAnet satellite netA Protocol for Packet Network Intercommunication V Cerf R Kahn IEEE Transactions on CommunicationsMay 1974 pp 637-648

100

The Internet virtualizing networks

ARPAnet satellite net

gateway

Internetwork layer (IP) addressing internetwork appears as single uniform entity despite underlying local network heterogeneitynetwork of networks

Gateway ldquoembed internetwork packets in local packet format or extract themrdquoroute (at internetwork level) to next gateway

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 51: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

101

Cerf amp Kahnrsquos Internetwork Architecture

What is virtualizedtwo layers of addressing internetwork and local networknew layer (IP) makes everything homogeneous at internetwork layerunderlying local network technology raquo cableraquo satelliteraquo 56K telephone modemraquo today ATM MPLS

hellip ldquoinvisiblerdquo at internetwork layer Looks like a link layer technology to IP

102

ATM and MPLS

ATM MPLS separate networks in their own rightraquo different service models addressing routing

from Internetviewed by Internet as logical link connecting IP routersraquo just like dialup link is really part of separate

network (telephone network)ATM MPLS of technical interest in their own right

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 52: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

103

Asynchronous Transfer Mode ATM

1990rsquos00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal integrated end-end transport of carry voice video dataraquo meeting timingQoS requirements of voice

video (versus Internet best-effort model)raquo ldquonext generationrdquo telephony technical roots

in telephone worldraquo packet-switching (fixed length packets

called ldquocellsrdquo) using virtual circuits

104

Multiprotocol label switching (MPLS)

initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding raquo borrowing ideas from Virtual Circuit (VC) approachraquo but IP datagram still keeps IP address

PPP or Ethernet header

IP header remainder of link-layer frameMPLS header

label Exp S TTL

20 3 1 5

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 53: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

105

MPLS capable routers

aka label-switched routerforwards packets to outgoing interface based only on label value (donrsquot inspect IP address)raquo MPLS forwarding table distinct from IP forwarding

tablessignaling protocol needed to set up forwardingraquo RSVP-TEraquo forwarding possible along paths that IP alone would

not allow (eg source-specific routing) raquo use MPLS for traffic engineering

must co-exist with IP-only routers

106

R1R2

DR3R4

R50

100

A

R6

in out outlabel label dest interface

6 - A 0

in out outlabel label dest interface

10 6 A 112 9 D 0

in out outlabel label dest interface

10 A 012 D 0

1

in out outlabel label dest interface

8 6 A 0

0

8 A 1

MPLS forwarding tables

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 54: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

107

Link Layer

Introduction and servicesError detection and

correction Multiple access protocolsLink-Layer

AddressingEthernet

Link-layer switchesPPPLink virtualization

MPLSA day in the life of a

web request

108

Synthesis a day in the life of a web request

journey down protocol stack completeraquo application transport network link

putting-it-all-together synthesisraquo goal identify review understand protocols

(at all layers) involved in seemingly simple scenario requesting www page

raquo scenario student attaches laptop to campus network requestsreceives wwwgooglecom

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 55: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

109

A day in the life scenario

Comcast network 68800013

Googlersquos network 64233160019 64233169105

web server

DNS server

school network 68802024

browser

web page

110

A day in the lifehellip connecting to the Internet

connecting laptop needs to get its own IP address addrof first-hop router addr of DNS server use DHCP

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCPDHCP

DHCP request encapsulatedin UDP encapsulated in IP encapsulated in 8021EthernetEthernet frame broadcast(dest FFFFFFFFFFFF) on LAN received at router running DHCP server

Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 56: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

111

A day in the lifehellip connecting to the Internet

DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server

router(runs DHCP)

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCPUDP

IPEthPhy

DHCP

DHCP

DHCP

DHCP

DHCP

encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client

Client now has IP address knows name amp addr of DNS server IP address of its first-hop router

DHCP client receives DHCP ACK reply

112

A day in the lifehellip ARP (before DNS before HTTP)

before sending HTTP request need IP address of wwwgooglecom DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS query created encapsulated in UDP encapsulated in IP encasulated in Eth In order to send frame to router need MAC address of router interface ARP

ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface

client now knows MAC address of first hop router so can now send frame containing DNS query

ARP query

EthPhy

ARP

ARP

ARP reply

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 57: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

113

A day in the lifehellip using DNS

DNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

DNS

IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

IP datagram forwarded from campus network into comcastnetwork routed (tables created by RIP OSPF IS-IS andor BGProuting protocols) to DNS server

demuxrsquoed to DNS serverDNS server replies to client with IP address of wwwgooglecom

Comcast network 68800013

DNS serverDNSUDP

IPEthPhy

DNS

DNS

DNS

DNS

114

A day in the lifehellip TCP connection carrying HTTP

HTTPTCPIP

EthPhy

HTTP

to send HTTP request client first opens TCP socket to web serverTCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server

TCP connection established64233169105web server

SYN

SYN

SYN

SYN

TCPIP

EthPhy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

web server responds with TCP SYNACK (step 2 in 3-way handshake)

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 58: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

115

A day in the lifehellip HTTP requestreply

HTTPTCPIP

EthPhy

HTTP

HTTP request sent into TCP socketIP datagram containing HTTP request routed to wwwgooglecom

IP datgram containing HTTP reply routed back to client64233169105

web server

HTTPTCPIP

EthPhy

web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTPHTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

web page finally ()displayed

116

DLC - Summary

principles behind data link layer servicesraquo error detection correctionraquo sharing a broadcast channel multiple accessraquo link layer addressing

instantiation and implementation of various link layer technologiesraquo Ethernetraquo switched LANS VLANsraquo PPPraquo virtualized networks as a link layer MPLS

synthesis a day in the life of a web request

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 59: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

117

DLC letrsquos take a breath

journey down protocol stack complete(except PHY)solid understanding of networking principles practicehellip could stop here hellip but lots of interesting topicsraquo wirelessraquo multimediaraquo security raquo network management

118

22 Data Link ControlData Link Control

Agenda

11 Session OverviewSession Overview

33 Summary and ConclusionSummary and Conclusion

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)

Page 60: Data Link Control · 2011. 2. 24. · Data Link Control - Roadmap Introduction and Services 22 Data Link Control Multiple Access Protocols Link Layer Addressing Ethernet Additional

119

Assignments amp Readings

Readings

raquo Chapter 5

Assignment 3

120

Next Session Data Link Control (Part II)