Download - Datalink Layer
Data Link Layer
CS 3516 ndash Computer Networks
Chapter 5 The Data Link LayerGoals bull Understand principles behind data link layer
servicesndash Error detection correctionndash Sharing a broadcast channel multiple accessndash Link layer addressingndash Reliable data transfer flow control (done in
Ch3)bull Instantiation and implementation of various
link layer technologies
Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Link Layer IntroductionSome terminologybull Hosts and routers are nodesbull Communication channels
that connect adjacent nodes along communication path are linksndash Wired linksndash Wireless linksndash LANs
bull Layer-2 packet is a frame encapsulates datagram
data-link layer has responsibility of transferring datagram from one node to adjacent node over link
Link Layer Contextbull Datagram transferred
by different link protocols over different linksndash eg Ethernet on first
link frame relay on intermediate links 80211 on last link
bull Each link protocol provides different servicesndash eg may or may not
provide rdt over link
Transportation analogybull Trip from Princeton to
Lausannendash limo Princeton to JFKndash plane JFK to Genevandash train Geneva to
Lausannebull Tourist = datagrambull Transport hop =
communication linkbull Transportation mode =
link layer protocolbull Travel agent = routing
algorithm
Link Layer Servicesbull Framing link access
ndash Encapsulate datagram into frame adding header trailer
ndash Channel access if shared mediumndash Medium Access Control (MAC) addresses used
in frame headers to identify source and dest bull Different from IP address
bull Reliable delivery between adjacent nodesndash We learned how to do this already (in ch3)ndash Seldom used on low bit-error link (fiber some
twisted pair)ndash Used for wireless links with high error rates
Link Layer Services (more)bull Flow control
ndash Pacing between adjacent sending and receiving nodes
bull Error detectionndash Errors caused by signal attenuation noisendash Receiver detects presence of errors
bull Signals sender for retransmission or drops frame bull Error correction
ndash Receiver identifies and corrects bit error(s) without resorting to retransmission
bull Half-duplex and full-duplexndash With half duplex nodes at both ends of link can
transmit but not at same time
Where is Link Layer Implementedbull In each and every hostbull Link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI card
80211 cardndash Implements link physical
layerbull Attaches into hostrsquos
system busesbull Combination of
hardware software and firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Adaptors Communicating
bull Sending sidendash Encapsulates datagram
in framendash Adds error checking
bits rdt flow control etc
bull Receiving sidendash Looks for errors rdt flow
control etcndash Extracts datagram passes
to upper layer
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliable― Protocol may miss some errors but rarely― Larger EDC field yields better detection and correction
otherwise
Simple - Parity CheckingSingle Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
Internet Checksum (review)
Senderbull Treat segment contents
as sequence of 16-bit integers
bull Checksum addition (1rsquos complement sum) of segment contents
bull Sender puts checksum value into UDP checksum field
Receiverbull Compute checksum of
received segmentbull Check if computed
checksum equals checksum field valuendash NO - error detectedndash YES - no error detected
But maybe errors nonetheless
Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted packet
Checksumming Cyclic Redundancy Check (CRC)
bull View data bits D as a binary numberbull Choose r+1 bit pattern (generator) G bull Goal choose r CRC bits R such that
ndash ltDRgt exactly divisible by G (modulo 2) ndash Receiver knows G divides ltDRgt by G
bull If non-zero remainder error detectedndash Can detect all burst errors less than r+1 bits
bull Widely used in practice (Ethernet 80211 WiFi)
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Chapter 5 The Data Link LayerGoals bull Understand principles behind data link layer
servicesndash Error detection correctionndash Sharing a broadcast channel multiple accessndash Link layer addressingndash Reliable data transfer flow control (done in
Ch3)bull Instantiation and implementation of various
link layer technologies
Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Link Layer IntroductionSome terminologybull Hosts and routers are nodesbull Communication channels
that connect adjacent nodes along communication path are linksndash Wired linksndash Wireless linksndash LANs
bull Layer-2 packet is a frame encapsulates datagram
data-link layer has responsibility of transferring datagram from one node to adjacent node over link
Link Layer Contextbull Datagram transferred
by different link protocols over different linksndash eg Ethernet on first
link frame relay on intermediate links 80211 on last link
bull Each link protocol provides different servicesndash eg may or may not
provide rdt over link
Transportation analogybull Trip from Princeton to
Lausannendash limo Princeton to JFKndash plane JFK to Genevandash train Geneva to
Lausannebull Tourist = datagrambull Transport hop =
communication linkbull Transportation mode =
link layer protocolbull Travel agent = routing
algorithm
Link Layer Servicesbull Framing link access
ndash Encapsulate datagram into frame adding header trailer
ndash Channel access if shared mediumndash Medium Access Control (MAC) addresses used
in frame headers to identify source and dest bull Different from IP address
bull Reliable delivery between adjacent nodesndash We learned how to do this already (in ch3)ndash Seldom used on low bit-error link (fiber some
twisted pair)ndash Used for wireless links with high error rates
Link Layer Services (more)bull Flow control
ndash Pacing between adjacent sending and receiving nodes
bull Error detectionndash Errors caused by signal attenuation noisendash Receiver detects presence of errors
bull Signals sender for retransmission or drops frame bull Error correction
ndash Receiver identifies and corrects bit error(s) without resorting to retransmission
bull Half-duplex and full-duplexndash With half duplex nodes at both ends of link can
transmit but not at same time
Where is Link Layer Implementedbull In each and every hostbull Link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI card
80211 cardndash Implements link physical
layerbull Attaches into hostrsquos
system busesbull Combination of
hardware software and firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Adaptors Communicating
bull Sending sidendash Encapsulates datagram
in framendash Adds error checking
bits rdt flow control etc
bull Receiving sidendash Looks for errors rdt flow
control etcndash Extracts datagram passes
to upper layer
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliable― Protocol may miss some errors but rarely― Larger EDC field yields better detection and correction
otherwise
Simple - Parity CheckingSingle Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
Internet Checksum (review)
Senderbull Treat segment contents
as sequence of 16-bit integers
bull Checksum addition (1rsquos complement sum) of segment contents
bull Sender puts checksum value into UDP checksum field
Receiverbull Compute checksum of
received segmentbull Check if computed
checksum equals checksum field valuendash NO - error detectedndash YES - no error detected
But maybe errors nonetheless
Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted packet
Checksumming Cyclic Redundancy Check (CRC)
bull View data bits D as a binary numberbull Choose r+1 bit pattern (generator) G bull Goal choose r CRC bits R such that
ndash ltDRgt exactly divisible by G (modulo 2) ndash Receiver knows G divides ltDRgt by G
bull If non-zero remainder error detectedndash Can detect all burst errors less than r+1 bits
bull Widely used in practice (Ethernet 80211 WiFi)
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Link Layer IntroductionSome terminologybull Hosts and routers are nodesbull Communication channels
that connect adjacent nodes along communication path are linksndash Wired linksndash Wireless linksndash LANs
bull Layer-2 packet is a frame encapsulates datagram
data-link layer has responsibility of transferring datagram from one node to adjacent node over link
Link Layer Contextbull Datagram transferred
by different link protocols over different linksndash eg Ethernet on first
link frame relay on intermediate links 80211 on last link
bull Each link protocol provides different servicesndash eg may or may not
provide rdt over link
Transportation analogybull Trip from Princeton to
Lausannendash limo Princeton to JFKndash plane JFK to Genevandash train Geneva to
Lausannebull Tourist = datagrambull Transport hop =
communication linkbull Transportation mode =
link layer protocolbull Travel agent = routing
algorithm
Link Layer Servicesbull Framing link access
ndash Encapsulate datagram into frame adding header trailer
ndash Channel access if shared mediumndash Medium Access Control (MAC) addresses used
in frame headers to identify source and dest bull Different from IP address
bull Reliable delivery between adjacent nodesndash We learned how to do this already (in ch3)ndash Seldom used on low bit-error link (fiber some
twisted pair)ndash Used for wireless links with high error rates
Link Layer Services (more)bull Flow control
ndash Pacing between adjacent sending and receiving nodes
bull Error detectionndash Errors caused by signal attenuation noisendash Receiver detects presence of errors
bull Signals sender for retransmission or drops frame bull Error correction
ndash Receiver identifies and corrects bit error(s) without resorting to retransmission
bull Half-duplex and full-duplexndash With half duplex nodes at both ends of link can
transmit but not at same time
Where is Link Layer Implementedbull In each and every hostbull Link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI card
80211 cardndash Implements link physical
layerbull Attaches into hostrsquos
system busesbull Combination of
hardware software and firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Adaptors Communicating
bull Sending sidendash Encapsulates datagram
in framendash Adds error checking
bits rdt flow control etc
bull Receiving sidendash Looks for errors rdt flow
control etcndash Extracts datagram passes
to upper layer
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliable― Protocol may miss some errors but rarely― Larger EDC field yields better detection and correction
otherwise
Simple - Parity CheckingSingle Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
Internet Checksum (review)
Senderbull Treat segment contents
as sequence of 16-bit integers
bull Checksum addition (1rsquos complement sum) of segment contents
bull Sender puts checksum value into UDP checksum field
Receiverbull Compute checksum of
received segmentbull Check if computed
checksum equals checksum field valuendash NO - error detectedndash YES - no error detected
But maybe errors nonetheless
Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted packet
Checksumming Cyclic Redundancy Check (CRC)
bull View data bits D as a binary numberbull Choose r+1 bit pattern (generator) G bull Goal choose r CRC bits R such that
ndash ltDRgt exactly divisible by G (modulo 2) ndash Receiver knows G divides ltDRgt by G
bull If non-zero remainder error detectedndash Can detect all burst errors less than r+1 bits
bull Widely used in practice (Ethernet 80211 WiFi)
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Link Layer IntroductionSome terminologybull Hosts and routers are nodesbull Communication channels
that connect adjacent nodes along communication path are linksndash Wired linksndash Wireless linksndash LANs
bull Layer-2 packet is a frame encapsulates datagram
data-link layer has responsibility of transferring datagram from one node to adjacent node over link
Link Layer Contextbull Datagram transferred
by different link protocols over different linksndash eg Ethernet on first
link frame relay on intermediate links 80211 on last link
bull Each link protocol provides different servicesndash eg may or may not
provide rdt over link
Transportation analogybull Trip from Princeton to
Lausannendash limo Princeton to JFKndash plane JFK to Genevandash train Geneva to
Lausannebull Tourist = datagrambull Transport hop =
communication linkbull Transportation mode =
link layer protocolbull Travel agent = routing
algorithm
Link Layer Servicesbull Framing link access
ndash Encapsulate datagram into frame adding header trailer
ndash Channel access if shared mediumndash Medium Access Control (MAC) addresses used
in frame headers to identify source and dest bull Different from IP address
bull Reliable delivery between adjacent nodesndash We learned how to do this already (in ch3)ndash Seldom used on low bit-error link (fiber some
twisted pair)ndash Used for wireless links with high error rates
Link Layer Services (more)bull Flow control
ndash Pacing between adjacent sending and receiving nodes
bull Error detectionndash Errors caused by signal attenuation noisendash Receiver detects presence of errors
bull Signals sender for retransmission or drops frame bull Error correction
ndash Receiver identifies and corrects bit error(s) without resorting to retransmission
bull Half-duplex and full-duplexndash With half duplex nodes at both ends of link can
transmit but not at same time
Where is Link Layer Implementedbull In each and every hostbull Link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI card
80211 cardndash Implements link physical
layerbull Attaches into hostrsquos
system busesbull Combination of
hardware software and firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Adaptors Communicating
bull Sending sidendash Encapsulates datagram
in framendash Adds error checking
bits rdt flow control etc
bull Receiving sidendash Looks for errors rdt flow
control etcndash Extracts datagram passes
to upper layer
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliable― Protocol may miss some errors but rarely― Larger EDC field yields better detection and correction
otherwise
Simple - Parity CheckingSingle Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
Internet Checksum (review)
Senderbull Treat segment contents
as sequence of 16-bit integers
bull Checksum addition (1rsquos complement sum) of segment contents
bull Sender puts checksum value into UDP checksum field
Receiverbull Compute checksum of
received segmentbull Check if computed
checksum equals checksum field valuendash NO - error detectedndash YES - no error detected
But maybe errors nonetheless
Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted packet
Checksumming Cyclic Redundancy Check (CRC)
bull View data bits D as a binary numberbull Choose r+1 bit pattern (generator) G bull Goal choose r CRC bits R such that
ndash ltDRgt exactly divisible by G (modulo 2) ndash Receiver knows G divides ltDRgt by G
bull If non-zero remainder error detectedndash Can detect all burst errors less than r+1 bits
bull Widely used in practice (Ethernet 80211 WiFi)
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Link Layer Contextbull Datagram transferred
by different link protocols over different linksndash eg Ethernet on first
link frame relay on intermediate links 80211 on last link
bull Each link protocol provides different servicesndash eg may or may not
provide rdt over link
Transportation analogybull Trip from Princeton to
Lausannendash limo Princeton to JFKndash plane JFK to Genevandash train Geneva to
Lausannebull Tourist = datagrambull Transport hop =
communication linkbull Transportation mode =
link layer protocolbull Travel agent = routing
algorithm
Link Layer Servicesbull Framing link access
ndash Encapsulate datagram into frame adding header trailer
ndash Channel access if shared mediumndash Medium Access Control (MAC) addresses used
in frame headers to identify source and dest bull Different from IP address
bull Reliable delivery between adjacent nodesndash We learned how to do this already (in ch3)ndash Seldom used on low bit-error link (fiber some
twisted pair)ndash Used for wireless links with high error rates
Link Layer Services (more)bull Flow control
ndash Pacing between adjacent sending and receiving nodes
bull Error detectionndash Errors caused by signal attenuation noisendash Receiver detects presence of errors
bull Signals sender for retransmission or drops frame bull Error correction
ndash Receiver identifies and corrects bit error(s) without resorting to retransmission
bull Half-duplex and full-duplexndash With half duplex nodes at both ends of link can
transmit but not at same time
Where is Link Layer Implementedbull In each and every hostbull Link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI card
80211 cardndash Implements link physical
layerbull Attaches into hostrsquos
system busesbull Combination of
hardware software and firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Adaptors Communicating
bull Sending sidendash Encapsulates datagram
in framendash Adds error checking
bits rdt flow control etc
bull Receiving sidendash Looks for errors rdt flow
control etcndash Extracts datagram passes
to upper layer
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliable― Protocol may miss some errors but rarely― Larger EDC field yields better detection and correction
otherwise
Simple - Parity CheckingSingle Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
Internet Checksum (review)
Senderbull Treat segment contents
as sequence of 16-bit integers
bull Checksum addition (1rsquos complement sum) of segment contents
bull Sender puts checksum value into UDP checksum field
Receiverbull Compute checksum of
received segmentbull Check if computed
checksum equals checksum field valuendash NO - error detectedndash YES - no error detected
But maybe errors nonetheless
Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted packet
Checksumming Cyclic Redundancy Check (CRC)
bull View data bits D as a binary numberbull Choose r+1 bit pattern (generator) G bull Goal choose r CRC bits R such that
ndash ltDRgt exactly divisible by G (modulo 2) ndash Receiver knows G divides ltDRgt by G
bull If non-zero remainder error detectedndash Can detect all burst errors less than r+1 bits
bull Widely used in practice (Ethernet 80211 WiFi)
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Link Layer Servicesbull Framing link access
ndash Encapsulate datagram into frame adding header trailer
ndash Channel access if shared mediumndash Medium Access Control (MAC) addresses used
in frame headers to identify source and dest bull Different from IP address
bull Reliable delivery between adjacent nodesndash We learned how to do this already (in ch3)ndash Seldom used on low bit-error link (fiber some
twisted pair)ndash Used for wireless links with high error rates
Link Layer Services (more)bull Flow control
ndash Pacing between adjacent sending and receiving nodes
bull Error detectionndash Errors caused by signal attenuation noisendash Receiver detects presence of errors
bull Signals sender for retransmission or drops frame bull Error correction
ndash Receiver identifies and corrects bit error(s) without resorting to retransmission
bull Half-duplex and full-duplexndash With half duplex nodes at both ends of link can
transmit but not at same time
Where is Link Layer Implementedbull In each and every hostbull Link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI card
80211 cardndash Implements link physical
layerbull Attaches into hostrsquos
system busesbull Combination of
hardware software and firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Adaptors Communicating
bull Sending sidendash Encapsulates datagram
in framendash Adds error checking
bits rdt flow control etc
bull Receiving sidendash Looks for errors rdt flow
control etcndash Extracts datagram passes
to upper layer
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliable― Protocol may miss some errors but rarely― Larger EDC field yields better detection and correction
otherwise
Simple - Parity CheckingSingle Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
Internet Checksum (review)
Senderbull Treat segment contents
as sequence of 16-bit integers
bull Checksum addition (1rsquos complement sum) of segment contents
bull Sender puts checksum value into UDP checksum field
Receiverbull Compute checksum of
received segmentbull Check if computed
checksum equals checksum field valuendash NO - error detectedndash YES - no error detected
But maybe errors nonetheless
Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted packet
Checksumming Cyclic Redundancy Check (CRC)
bull View data bits D as a binary numberbull Choose r+1 bit pattern (generator) G bull Goal choose r CRC bits R such that
ndash ltDRgt exactly divisible by G (modulo 2) ndash Receiver knows G divides ltDRgt by G
bull If non-zero remainder error detectedndash Can detect all burst errors less than r+1 bits
bull Widely used in practice (Ethernet 80211 WiFi)
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Link Layer Services (more)bull Flow control
ndash Pacing between adjacent sending and receiving nodes
bull Error detectionndash Errors caused by signal attenuation noisendash Receiver detects presence of errors
bull Signals sender for retransmission or drops frame bull Error correction
ndash Receiver identifies and corrects bit error(s) without resorting to retransmission
bull Half-duplex and full-duplexndash With half duplex nodes at both ends of link can
transmit but not at same time
Where is Link Layer Implementedbull In each and every hostbull Link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI card
80211 cardndash Implements link physical
layerbull Attaches into hostrsquos
system busesbull Combination of
hardware software and firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Adaptors Communicating
bull Sending sidendash Encapsulates datagram
in framendash Adds error checking
bits rdt flow control etc
bull Receiving sidendash Looks for errors rdt flow
control etcndash Extracts datagram passes
to upper layer
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliable― Protocol may miss some errors but rarely― Larger EDC field yields better detection and correction
otherwise
Simple - Parity CheckingSingle Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
Internet Checksum (review)
Senderbull Treat segment contents
as sequence of 16-bit integers
bull Checksum addition (1rsquos complement sum) of segment contents
bull Sender puts checksum value into UDP checksum field
Receiverbull Compute checksum of
received segmentbull Check if computed
checksum equals checksum field valuendash NO - error detectedndash YES - no error detected
But maybe errors nonetheless
Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted packet
Checksumming Cyclic Redundancy Check (CRC)
bull View data bits D as a binary numberbull Choose r+1 bit pattern (generator) G bull Goal choose r CRC bits R such that
ndash ltDRgt exactly divisible by G (modulo 2) ndash Receiver knows G divides ltDRgt by G
bull If non-zero remainder error detectedndash Can detect all burst errors less than r+1 bits
bull Widely used in practice (Ethernet 80211 WiFi)
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Where is Link Layer Implementedbull In each and every hostbull Link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI card
80211 cardndash Implements link physical
layerbull Attaches into hostrsquos
system busesbull Combination of
hardware software and firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Adaptors Communicating
bull Sending sidendash Encapsulates datagram
in framendash Adds error checking
bits rdt flow control etc
bull Receiving sidendash Looks for errors rdt flow
control etcndash Extracts datagram passes
to upper layer
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliable― Protocol may miss some errors but rarely― Larger EDC field yields better detection and correction
otherwise
Simple - Parity CheckingSingle Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
Internet Checksum (review)
Senderbull Treat segment contents
as sequence of 16-bit integers
bull Checksum addition (1rsquos complement sum) of segment contents
bull Sender puts checksum value into UDP checksum field
Receiverbull Compute checksum of
received segmentbull Check if computed
checksum equals checksum field valuendash NO - error detectedndash YES - no error detected
But maybe errors nonetheless
Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted packet
Checksumming Cyclic Redundancy Check (CRC)
bull View data bits D as a binary numberbull Choose r+1 bit pattern (generator) G bull Goal choose r CRC bits R such that
ndash ltDRgt exactly divisible by G (modulo 2) ndash Receiver knows G divides ltDRgt by G
bull If non-zero remainder error detectedndash Can detect all burst errors less than r+1 bits
bull Widely used in practice (Ethernet 80211 WiFi)
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Adaptors Communicating
bull Sending sidendash Encapsulates datagram
in framendash Adds error checking
bits rdt flow control etc
bull Receiving sidendash Looks for errors rdt flow
control etcndash Extracts datagram passes
to upper layer
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliable― Protocol may miss some errors but rarely― Larger EDC field yields better detection and correction
otherwise
Simple - Parity CheckingSingle Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
Internet Checksum (review)
Senderbull Treat segment contents
as sequence of 16-bit integers
bull Checksum addition (1rsquos complement sum) of segment contents
bull Sender puts checksum value into UDP checksum field
Receiverbull Compute checksum of
received segmentbull Check if computed
checksum equals checksum field valuendash NO - error detectedndash YES - no error detected
But maybe errors nonetheless
Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted packet
Checksumming Cyclic Redundancy Check (CRC)
bull View data bits D as a binary numberbull Choose r+1 bit pattern (generator) G bull Goal choose r CRC bits R such that
ndash ltDRgt exactly divisible by G (modulo 2) ndash Receiver knows G divides ltDRgt by G
bull If non-zero remainder error detectedndash Can detect all burst errors less than r+1 bits
bull Widely used in practice (Ethernet 80211 WiFi)
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliable― Protocol may miss some errors but rarely― Larger EDC field yields better detection and correction
otherwise
Simple - Parity CheckingSingle Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
Internet Checksum (review)
Senderbull Treat segment contents
as sequence of 16-bit integers
bull Checksum addition (1rsquos complement sum) of segment contents
bull Sender puts checksum value into UDP checksum field
Receiverbull Compute checksum of
received segmentbull Check if computed
checksum equals checksum field valuendash NO - error detectedndash YES - no error detected
But maybe errors nonetheless
Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted packet
Checksumming Cyclic Redundancy Check (CRC)
bull View data bits D as a binary numberbull Choose r+1 bit pattern (generator) G bull Goal choose r CRC bits R such that
ndash ltDRgt exactly divisible by G (modulo 2) ndash Receiver knows G divides ltDRgt by G
bull If non-zero remainder error detectedndash Can detect all burst errors less than r+1 bits
bull Widely used in practice (Ethernet 80211 WiFi)
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliable― Protocol may miss some errors but rarely― Larger EDC field yields better detection and correction
otherwise
Simple - Parity CheckingSingle Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
Internet Checksum (review)
Senderbull Treat segment contents
as sequence of 16-bit integers
bull Checksum addition (1rsquos complement sum) of segment contents
bull Sender puts checksum value into UDP checksum field
Receiverbull Compute checksum of
received segmentbull Check if computed
checksum equals checksum field valuendash NO - error detectedndash YES - no error detected
But maybe errors nonetheless
Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted packet
Checksumming Cyclic Redundancy Check (CRC)
bull View data bits D as a binary numberbull Choose r+1 bit pattern (generator) G bull Goal choose r CRC bits R such that
ndash ltDRgt exactly divisible by G (modulo 2) ndash Receiver knows G divides ltDRgt by G
bull If non-zero remainder error detectedndash Can detect all burst errors less than r+1 bits
bull Widely used in practice (Ethernet 80211 WiFi)
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Simple - Parity CheckingSingle Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
Internet Checksum (review)
Senderbull Treat segment contents
as sequence of 16-bit integers
bull Checksum addition (1rsquos complement sum) of segment contents
bull Sender puts checksum value into UDP checksum field
Receiverbull Compute checksum of
received segmentbull Check if computed
checksum equals checksum field valuendash NO - error detectedndash YES - no error detected
But maybe errors nonetheless
Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted packet
Checksumming Cyclic Redundancy Check (CRC)
bull View data bits D as a binary numberbull Choose r+1 bit pattern (generator) G bull Goal choose r CRC bits R such that
ndash ltDRgt exactly divisible by G (modulo 2) ndash Receiver knows G divides ltDRgt by G
bull If non-zero remainder error detectedndash Can detect all burst errors less than r+1 bits
bull Widely used in practice (Ethernet 80211 WiFi)
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Internet Checksum (review)
Senderbull Treat segment contents
as sequence of 16-bit integers
bull Checksum addition (1rsquos complement sum) of segment contents
bull Sender puts checksum value into UDP checksum field
Receiverbull Compute checksum of
received segmentbull Check if computed
checksum equals checksum field valuendash NO - error detectedndash YES - no error detected
But maybe errors nonetheless
Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted packet
Checksumming Cyclic Redundancy Check (CRC)
bull View data bits D as a binary numberbull Choose r+1 bit pattern (generator) G bull Goal choose r CRC bits R such that
ndash ltDRgt exactly divisible by G (modulo 2) ndash Receiver knows G divides ltDRgt by G
bull If non-zero remainder error detectedndash Can detect all burst errors less than r+1 bits
bull Widely used in practice (Ethernet 80211 WiFi)
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Checksumming Cyclic Redundancy Check (CRC)
bull View data bits D as a binary numberbull Choose r+1 bit pattern (generator) G bull Goal choose r CRC bits R such that
ndash ltDRgt exactly divisible by G (modulo 2) ndash Receiver knows G divides ltDRgt by G
bull If non-zero remainder error detectedndash Can detect all burst errors less than r+1 bits
bull Widely used in practice (Ethernet 80211 WiFi)
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
CRC Example ndash Choosing RWant
D2r XOR R = nGEquivalently
D2r = nG XOR R Equivalently If we divide D2r by
G want remainder R
R = remainder[ ]D2r
G
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
CRC Standards
bull Defined for 8 12 16 and 32 bit genrators (G)
bull CRC-32 adopted by many IEEE link-layer protocols uses generatorndash Gcrc-32 =
100000100110000010001110110110111bull Detects all errors burst less than 33 bitsbull Detects all odd number bit errorsbull Burst errors greater than 33 bits with
probability 1-05r
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull point-to-point (not shared)
ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host
bull broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Multiple Access Protocolsbull Single shared broadcast channel bull Two or more simultaneous transmissions by nodes
interference ndash collision if node receives two or more signals at the same
timeMultiple access protocolbull Distributed algorithm determines how nodes share
channel (ie determine whenwho node can transmit)
bull Communication about channel sharing must use channel itself ndash no ldquoout-of-bandrdquo channel for coordination
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Ideal Multiple Access ProtocolBroadcast 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 RM (no overhead)3 Fully decentralized
ndash No special node to coordinate transmissionsndash No synchronization of clocks slots
4 Simple
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
MAC Protocols a TaxonomyThree broad classesbull Channel Partitioning
ndash Divide channel into smaller ldquopiecesrdquo (time slots frequency)
ndash Allocate piece to node for exclusive usebull Random Access
ndash Channel not divided allow collisionsndash ldquoRecoverrdquo from collisions
bull Taking turnsndash Nodes take turns but nodes with more to send can
perhaps take longer turns
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access bull Access to channel in rounds bull Each station gets fixed length slot (length =
pkt trans time) in each round bull Unused slots go idle bull Example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access bull Channel spectrum divided into frequency bandsbull Each station assigned fixed frequency bandbull Unused transmission time in frequency bands go
idle bull Example 6-station LAN 134 have pkt
frequency bands 256 idle fr
eque
ncy
band
s time
FDM cable
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Random Access Protocolsbull When node has packet to send
ndash Transmit at full channel data rate Rndash No a priori coordination among nodes
bull Two or more transmitting nodes ldquocollisionrdquobull Random access MAC protocol specifies
ndash How to detect collisionsndash How to recover from collisions (eg via delayed
retransmissions)bull Examples of random access MAC protocols
ndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Slotted ALOHAAssumptionsbull All frames same sizebull Time divided into
equal size slots (time to transmit 1 frame)
bull Nodes start to transmit only slot beginning
bull Nodes are synchronized
bull If 2 or more nodes transmit in slot all nodes detect collision
Operationbull When node obtains
fresh frame transmits in next slotndash If no collision node can
send new frame in next slot
ndash If collision node retransmits frame in each subsequent slot with prob p until success
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Slotted ALOHA
Prosbull Single active node
can continuously transmit at full rate of channel
bull Highly decentralized only slots in nodes need to be in sync
bull Simple
Consbull Collisions wasting
slotsbull Idle slotsbull Nodes may be able to
detect collision in less than time to transmit packet
bull Clock synchronization
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Slotted Aloha Efficiency
bull Suppose N nodes with many frames to send each transmits in slot with probability p
bull Prob that given node has success in a slot = p(1-p)N-1
bull Prob that any node has a success = Np(1-p)N-1
bull Max efficiency find prsquo that maximizes Np(1-p)N-1
bull For many nodes take limit of Nprsquo(1-prsquo)N-1 as N goes to infinity gives
Max efficiency = 1e ~ 37
Efficiency long-run fraction of successful slots (many nodes all with many frames to send)
At best channelused for useful transmissions 37of time
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Pure (Unslotted) ALOHAbull Unslotted Aloha simpler no synchronizationbull When frame first arrives
ndash Transmit immediately bull Collision probability increases
ndash Frame sent at t0 collides with other frames sent in [t0-1t0+1]
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Pure Aloha EfficiencyP(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 than slotted Aloha
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitbull If channel sensed idle transmit entire framebull If channel sensed busy defer transmission
bull Human analogy someone else talking Donrsquot interrupt
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
CSMA Collisions
Collisions can still occurPropagation delay means two nodes may not heareach otherrsquos transmission
CollisionEntire packet transmission time wasted
spatial layout of nodes
NoteRole of distance amp propagation delay in determining collision probability
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMAndash Collisions detected within short timendash Colliding transmissions aborted reducing
channel wastage bull Collision detection
ndash Easy in wired LANsbull Measure signal strengths compare transmitted
received signalsndash Difficult in wireless LANs
bull Received signal strength overwhelmed by local transmission strength
bull Human analogy the polite conversationalist
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
CSMACD (Collision Detection)
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols
ndash Share channel efficiently and fairly at high load
ndash Inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocolsndash Efficient at low load single node can fully
utilize channelndash High load collision overhead
ldquoTaking turnsrdquo protocolsndash Look for best of both worlds
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
ldquoTaking Turnsrdquo MAC protocolsPolling bull Master node
ldquoinvitesrdquo slave nodes to transmit in turn
bull Typically used with ldquodumbrdquo slave devices
bull Concernsndash Polling overhead ndash Latencyndash Single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token
passed from one node to next sequentially
bull Token messagebull Concerns
- token overhead - latency- single point of failure
(token)
T
data
(nothingto send)
T
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Summary of MAC protocolsbull Channel partitioning
ndash Time Division Frequency Divisionbull Random access (dynamic)
ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)
hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211
bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
MAC Addresses
bull 32-bit IP address ndash Network-layer addressndash Used to get datagram to destination IP subnet
bull MAC (or LAN or physical or Ethernet) address ndash Function get frame from one interface to
another physically-connected interface (same network)
ndash 48 bit MAC address (for most LANs)bull burned in NIC ROM also sometimes software
settable
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
LAN AddressesEach 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)
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
LAN Address (more)bull MACLAN address allocation administered by
IEEEbull Manufacturer buys portion of MAC address
space (to assure uniqueness)bull Analogy (a) MAC address like Social Security Number (b) IP address like postal addressbull MAC flat address portability
ndash Can move LAN card from one LAN to anotherbull IP hierarchical address NOT portable
ndash Address depends on IP subnet to which node is attached
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
ARP Address Resolution Protocolbull Each IP node (host
router) on LAN has ARP table
bull ARP table IPMAC address mappings for some LAN nodes
IP address MAC address TTLndash TTL (Time To Live) time
after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53 LAN
137196723
137196778
137196714
137196788
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
ARP Protocol Same LANbull A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
bull A broadcasts ARP query packet containing Bs IP address ndash dest MAC address =
FF-FF-FF-FF-FF-FFndash all machines on LAN
receive ARP query bull B receives ARP packet
replies to A with its (Bs) MAC addressndash frame sent to Arsquos MAC
address (unicast)
bull A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ndash soft state information that times out (goes away)
unless refreshedbull ARP is ldquoplug-and-playrdquo
ndash nodes create their ARP tables without intervention from net administrator
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Addressing Routing to Another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Walkthrough send datagram from A to B via R assume A knows Brsquos IP address
bull Two ARP tables in router R one for each IP network (LAN)
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
bull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest
frame contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its
destined to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to
B
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
This is a really importantexample ndash make sure youunderstand
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
EthernetDominant wired LAN technology bull Cheap ($20) for NICbull First widely used LAN technologybull Simpler cheaper than token LANs and ATMbull Kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Topology (Bus and Star)bull Bus topology popular through mid 90s
ndash All nodes in same collision domain (can collide with each other)
bull Today star topology prevailsndash Active switch in center (contrast with hub)ndash Each ldquospokerdquo runs a (separate) Ethernet protocol
(nodes do not collide with each other)
switch
bus coaxial cable star
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Ethernet Frame StructureSending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble bull 7 bytes with pattern 10101010 followed by
one byte with pattern 10101011bull Used to synchronize receiver sender clock
rates
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Ethernet Frame Structure (more)bull Addresses 6 bytes
ndash If adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
ndash otherwise adapter discards framebull Type indicates higher layer protocol (mostly IP
but others possible eg Novell IPX AppleTalk)bull CRC checked at receiver if error is detected
frame is dropped
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Ethernet Unreliable Connectionless
bull Connectionless No handshaking between sending and receiving NICs
bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash Stream of datagrams passed to network layer can have
gaps (missing datagrams)ndash Gaps will be filled if app is using TCPndash Otherwise app will see gaps
bull Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Ethernet CSMACD algorithm1 NIC receives datagram
from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Ethernetrsquos CSMACD (more)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 Backoff bull Goal adapt retransmission
attempts to estimated current loadndash heavy load random
wait will be longerbull First collision choose K
from 01 delay is K 512 bit transmission times
bull After second collision choose K from 0123hellip
bull After ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
CSMACD Efficiencybull Tprop = max prop delay between 2 nodes in LANbull ttrans = time to transmit max-size frame
bull Efficiency goes to 1 ndash as tprop goes to 0ndash as ttrans goes to infinity
bull Better performance than ALOHA and simple cheap decentralized
transprop ttefficiency
511
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
8023 Ethernet Standards Link amp Physical Layers
bull Many different Ethernet standardsndash Common MAC protocol and frame formatndash Different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bpsndash Different physical layer media fiber
cableapplicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twistedpair) physical layer
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Manchester Encoding
bull Used in 10BaseTbull Each bit has a transitionbull Allows clocks in sending and receiving nodes
to synchronize to each otherndash No need for a centralized global clock among nodes
bull Hey this is physical-layer stuff
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-layer
Addressingbull 55 Ethernet
bull 56 Link-layer switches LANs VLANs
bull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Hubshellip physical-layer (ldquodumbrdquo) repeaters
ndash bits coming in one link go out all other links at same rate
ndash all nodes connected to hub can collide with one another
ndash no frame bufferingndash no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Switchbull Link-layer device smarter than hubs
take active rolendash store forward Ethernet framesndash 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
bull Transparentndash hosts are unaware of presence of switches
bull Plug-and-play self-learningndash switches do not need to be configured
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Switch Allows Multiple Simultaneous Transmissions
bull Hosts have dedicated direct connection to switch
bull Switches buffer packetsbull Ethernet protocol used on
each incoming link but no collisions full duplexndash Each link is its own collision
domainbull Switching A-to-Arsquo and B-
to-Brsquo simultaneously without collisions ndash Not possible with dumb hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Switch Tablebull Q how does switch know
that Arsquo reachable via interface 4 Brsquo reachable via interface 5
bull A each switch has a switch table each entryndash (MAC address of host
interface to reach host time stamp)
bull looks like a routing tablebull Q how are entries created
maintained in switch table ndash something like a routing
protocol
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 2 345
6
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Switch Self-learningbull Switch learns which
hosts can be reached through which interfacesndash When frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
ndash 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
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Switch Frame Filtering Forwarding
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 frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
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 Arsquobull frame destination
unknownflood
Arsquo A
bull Destination A location known
Arsquo 4 60
selective send
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Interconnecting Switchesbull Switches can be connected together
AB
bull Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
bull A self learning (works exactly the same as in single-switch case)
S1
C DE
FS2
S4
S3
HI
G
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Self-learning multi-switch example
Suppose C sends frame to I I responds to C
bull Q show switch tables and packet forwarding in S1 S2 S3 S4
AB
S1
C DE
FS2
S4
S3
HI
G
12
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Institutional Network
to externalnetwork
router
IP subnet
mail server
web server
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Switches vs Routersbull both store-and-forward devices
ndash routers network layer devices (examine network layer headers)
ndash switches are link layer devicesbull routers maintain routing tables implement
routing algorithmsbull switches maintain switch tables implement
filtering learning algorithms
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Data Link Layerbull 51 Introduction and
servicesbull 52 Error detection
and correction bull 53 Multiple access
protocolsbull 54 Link-Layer
Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
But First Elements of Wireless (WiFi)
bull Note some key characteristics of Wireless that differ from wired
bull 80211 (WiFi) as contrast to 8023 (Ethernet)
(Bits of Ch 61 ndash 63)
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Characteristics of Selected Wireless Link Standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor200m ndash 4 Km
Long-rangeoutdoor5Km ndash 20 Km
056
384
14
5-1154
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
200 80211n
Dat
a ra
te (M
bps) data
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Wireless Link Characteristics (1)Differences from wired link hellip
ndash decreased signal strength radio signal attenuates as it propagates through matter (path loss)
ndash interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
ndash multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across (even a point to point) wireless link much more ldquodifficultrdquo
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Wireless Link Characteristics (2)bull SNR signal-to-noise ratio
ndash larger SNR ndash easier to extract signal from noise (a ldquogood thingrdquo)
bull SNR versus BER tradeoffsndash Given physical layer
increase power increase SNR decrease BER
ndash Given SNR choose physical layer that meets BER requirement giving highest thruputbull SNR may change with
mobility dynamically adapt physical layer (modulation technique rate)
10 20 30 40
QAM256 (8 Mbps)
QAM16 (4 Mbps)
BPSK (1 Mbps)
SNR(dB)B
ER
10-1
10-2
10-3
10-5
10-6
10-7
10-4
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Wireless Network CharacteristicsMultiple wireless senders and receivers create
additional problems (beyond multiple access)
AB
C
Hidden terminal problembull B A hear each otherbull B C hear each otherbull A C can not hear each
othermeans A C unaware of their
interference at B
A B C
Arsquos signalstrength
space
Crsquos signalstrength
Signal attenuationbull B A hear each otherbull B C hear each otherbull A C can not hear each
other interfering at B
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
IEEE 80211 Wireless LANbull 80211b
ndash 24-5 GHz unlicensed spectrum
ndash up to 11 Mbpsndash direct sequence spread
spectrum (DSSS) in physical layerbull all hosts use same
chipping code
bull 80211a ndash 5-6 GHz rangendash up to 54 Mbps
bull 80211g ndash 24-5 GHz rangendash up to 54 Mbps
bull 80211n multiple antennaendash 24-5 GHz rangendash up to 200 Mbps
bull All use CSMACA for multiple accessbull All have base-station and ad-hoc network
versions
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
IEEE 80211 multiple accessbull Avoid collisions 2+ nodes transmitting at same
timebull 80211 CSMA - sense before transmitting
ndash donrsquot collide with ongoing transmission by other nodebull 80211 no collision detection
ndash difficult to receive (sense collisions) when transmitting due to weak received signals (fading)
ndash canrsquot sense all collisions in any case hidden terminal fading
ndash goal avoid collisions CSMAC(ollision)A(voidance)
A B
CA B C
Arsquos signalstrength
space
Crsquos signalstrength
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
IEEE 80211 MAC Protocol CSMACA80211 sender1 if sense channel idle for DIFS then
transmit entire frame (no CD)2 if sense channel busy then
start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK increase random backoff
interval repeat 280211 receiver- if frame received OK return ACK after SIFS (ACK needed due
to hidden terminal problem)
sender receiver
DIFS
data
SIFS
ACK
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
80211 Advanced CapabilitiesRate Adaptationbull Base station mobile
dynamically change transmission rate (physical layer modulation technique) as mobile moves SNR varies
QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)
10 20 30 40SNR(dB)
BE
R
10-1
10-2
10-3
10-5
10-6
10-7
10-4
operating point
1 SNR decreases BER increase as node moves away from base station2 When BER becomes too high switch to lower transmission rate but with lower BER
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
More Wireless
bull Power managementbull Other protocols Zigbee 3G WiMax hellipbull Mobilitybull Security
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Link Layerbull 51 Introduction and servicesbull 52 Error detection and correction bull 53Multiple access protocolsbull 54 Link-Layer Addressingbull 55 Ethernet
bull 56 Link-layer switchesbull 57 PPPbull 58 Link virtualization
MPLSbull 59 A day in the life of
a web request
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Synthesis a day in the life of a Web request
bull Journey down protocol stack completendash Application Transport Network Data
Linkbull Putting-it-all-together synthesis
ndash goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
ndash scenario student attaches laptop to campus network requestsreceives wwwgooglecom
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
A day in the life Scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
browser
web page
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
A day in the lifehellip connecting to the Internet
bull connecting laptop needs to get its own IP address addr of 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 encapsulated in UDP encapsulated in IP encapsulated in 8021 Ethernet Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server
Ethernet demuxrsquoed to IP demuxrsquoed UDP demuxrsquoed to DHCP
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
A day in the lifehellip connecting to the Internet
bull 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
bull 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
bull DHCP client receives DHCP ACK reply
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
A day in the lifehellip ARP (before DNS before HTTP)
bull Before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
bull 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
bull ARP query broadcast received by router which replies with ARP reply giving MAC address of router interfacebull Client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
A day in the lifehellip using DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
bull IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
bull IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
bull demuxrsquoed to DNS serverbull DNS server replies to
client with IP address of wwwgooglecom
Comcast network 68800013
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
A day in the lifehellip TCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
bull To send HTTP request client first opens TCP socket to web server
bull TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
bull TCP connection established
64233169105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
bull Web server responds with TCP SYNACK (step 2 in 3-way handshake)
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
A day in the lifehellip HTTP requestreply HTTPTCPIP
EthPhy
HTTP
bull HTTP request sent into TCP socket
bull IP datagram containing HTTP request routed to wwwgooglecom
bull IP datgram containing HTTP reply routed back to client
64233169105web server
HTTPTCPIPEthPhy
bull Web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
bull Web page finally () displayed
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Chapter 5 Summarybull Principles behind data link layer services
ndash error detection correctionndash sharing a broadcast channel multiple accessndash link layer addressing
bull Instantiation and implementation of various link layer technologiesndash Addressingndash Ethernetndash Switched LANS
bull Synthesis a day in the life of a web request
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-
Chapter 5 Letrsquos take a breathbull Journey down protocol stack complete
(except PHY)bull Solid understanding of networking
principles practicebull hellip could stop here hellip but lots of
interesting topicsndash Wirelessndash Multimediandash Security ndash Network management
- Data Link Layer CS 3516 ndash Computer Networks
- Chapter 5 The Data Link Layer
- Link Layer
- Link Layer Introduction
- Link Layer Context
- Link Layer Services
- Link Layer Services (more)
- Where is Link Layer Implemented
- Adaptors Communicating
- Data Link Layer
- Error Detection
- Simple - Parity Checking
- Internet Checksum (review)
- Checksumming Cyclic Redundancy Check (CRC)
- CRC Example ndash Choosing R
- CRC Standards
- Data Link Layer (2)
- Multiple Access Links and Protocols
- Multiple Access Protocols
- Ideal Multiple Access Protocol
- MAC Protocols a Taxonomy
- Channel Partitioning MAC protocols TDMA
- Channel Partitioning MAC protocols FDMA
- Random Access Protocols
- Slotted ALOHA
- Slotted ALOHA (2)
- Slotted Aloha Efficiency
- Pure (Unslotted) ALOHA
- Pure Aloha Efficiency
- CSMA (Carrier Sense Multiple Access)
- CSMA Collisions
- CSMACD (Collision Detection)
- CSMACD (Collision Detection) (2)
- ldquoTaking Turnsrdquo MAC protocols
- ldquoTaking Turnsrdquo MAC protocols (2)
- ldquoTaking Turnsrdquo MAC protocols (3)
- Summary of MAC protocols
- Data Link Layer (3)
- MAC Addresses
- LAN Addresses
- LAN Address (more)
- ARP Address Resolution Protocol
- ARP Protocol Same LAN
- Addressing Routing to Another LAN
- Slide 45
- Data Link Layer (4)
- Ethernet
- Topology (Bus and Star)
- Ethernet Frame Structure
- Ethernet Frame Structure (more)
- Ethernet Unreliable Connectionless
- Ethernet CSMACD algorithm
- Ethernetrsquos CSMACD (more)
- CSMACD Efficiency
- 8023 Ethernet Standards Link amp Physical Layers
- Manchester Encoding
- Data Link Layer (5)
- Hubs
- Switch
- Switch Allows Multiple Simultaneous Transmissions
- Switch Table
- Switch Self-learning
- Switch Frame Filtering Forwarding
- Self-learning Forwarding example
- Interconnecting Switches
- Self-learning multi-switch example
- Institutional Network
- Switches vs Routers
- Data Link Layer (6)
- But First Elements of Wireless (WiFi)
- Characteristics of Selected Wireless Link Standards
- Wireless Link Characteristics (1)
- Wireless Link Characteristics (2)
- Wireless Network Characteristics
- IEEE 80211 Wireless LAN
- IEEE 80211 multiple access
- IEEE 80211 MAC Protocol CSMACA
- Slide 78
- More Wireless
- Link Layer (2)
- Synthesis a day in the life of a Web request
- A day in the life Scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellip TCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
- Chapter 5 Summary
- Chapter 5 Letrsquos take a breath
-