Upload
gervais-harrell
View
219
Download
0
Embed Size (px)
Citation preview
CPSC 441 Link Layer 1
CPSC 441 Link Layer 2
Our Goals hellip understand principles behind data link layer
services error detection correction sharing a broadcast channel multiple access link layer addressing done reliable data transfer flow control done
instantiation and implementation of various link layer technologies
CPSC 441 Link Layer 3
Link Layer
Introduction and services (review)
Error detection and correction
Multiple access protocols
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 4
Link Layer ReviewSome terminology hosts and routers are nodes communication channels
that connect adjacent nodes along communication path are links wired links wireless links LANs
layer-2 packet is a frame encapsulates datagram
ldquolinkrdquo
data-link layer has responsibility of transferring datagram from one node to adjacent node over a link
CPSC 441 Link Layer 5
Link layer Review
Datagram transferred by different link protocols over different links eg Ethernet on first link frame relay on intermediate
links 80211 on last link
Each link protocol provides different services eg may or may not provide reliable data transfer over
link
CPSC 441 Link Layer 6
Link Layer Services Review Framing link access
Reliable delivery between adjacent nodes
Flow Control
Error Detection
Error Correction
Half-duplex and full-duplex
CPSC 441 Link Layer 7
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 8
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction
CPSC 441 Link Layer 9
Parity Checking
Single Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
CPSC 441 Link Layer 10
Cyclic Redundancy CheckPolynomial Codes
A (n+1)-bit message can be represented as a polynomial of degree n For example X = 10011010 M(X) =
So a sender and receiver can be considered to exchange polyns
Choose k+1 bit pattern (divisor) C(X) a polyn of degree k
goal choose k CRC bits R such that ltMRgt exactly divisible by C (modulo 2) receiver knows C divides ltMRgt by C If non-zero
remainder error detected can detect all burst errors less than k+1 bits
xxxx 347
CPSC 441 Link Layer 11
CRC continued hellip
Goal design P(X) such that it is exactly divisible by C(X)
Multiply M(X) by xk (add k zerorsquos to the end of the message) to get T(X)
Divide T(X) by C(X) and find the remainder R(X) Subtract the remainder from T(X) to get P(X)
P(X) is now exactly divisible by C(X)
Remember ndash all additionsubtract use modulo-2 arithmetic
CPSC 441 Link Layer 12
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 13
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) traditional Ethernet upstream HFC 80211 wireless LAN
CPSC 441 Link Layer 14
When are Multiple Access Protocols Required
single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time (examples LANs Wireless-LANs)
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 2
Our Goals hellip understand principles behind data link layer
services error detection correction sharing a broadcast channel multiple access link layer addressing done reliable data transfer flow control done
instantiation and implementation of various link layer technologies
CPSC 441 Link Layer 3
Link Layer
Introduction and services (review)
Error detection and correction
Multiple access protocols
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 4
Link Layer ReviewSome terminology hosts and routers are nodes communication channels
that connect adjacent nodes along communication path are links wired links wireless links LANs
layer-2 packet is a frame encapsulates datagram
ldquolinkrdquo
data-link layer has responsibility of transferring datagram from one node to adjacent node over a link
CPSC 441 Link Layer 5
Link layer Review
Datagram transferred by different link protocols over different links eg Ethernet on first link frame relay on intermediate
links 80211 on last link
Each link protocol provides different services eg may or may not provide reliable data transfer over
link
CPSC 441 Link Layer 6
Link Layer Services Review Framing link access
Reliable delivery between adjacent nodes
Flow Control
Error Detection
Error Correction
Half-duplex and full-duplex
CPSC 441 Link Layer 7
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 8
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction
CPSC 441 Link Layer 9
Parity Checking
Single Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
CPSC 441 Link Layer 10
Cyclic Redundancy CheckPolynomial Codes
A (n+1)-bit message can be represented as a polynomial of degree n For example X = 10011010 M(X) =
So a sender and receiver can be considered to exchange polyns
Choose k+1 bit pattern (divisor) C(X) a polyn of degree k
goal choose k CRC bits R such that ltMRgt exactly divisible by C (modulo 2) receiver knows C divides ltMRgt by C If non-zero
remainder error detected can detect all burst errors less than k+1 bits
xxxx 347
CPSC 441 Link Layer 11
CRC continued hellip
Goal design P(X) such that it is exactly divisible by C(X)
Multiply M(X) by xk (add k zerorsquos to the end of the message) to get T(X)
Divide T(X) by C(X) and find the remainder R(X) Subtract the remainder from T(X) to get P(X)
P(X) is now exactly divisible by C(X)
Remember ndash all additionsubtract use modulo-2 arithmetic
CPSC 441 Link Layer 12
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 13
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) traditional Ethernet upstream HFC 80211 wireless LAN
CPSC 441 Link Layer 14
When are Multiple Access Protocols Required
single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time (examples LANs Wireless-LANs)
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 3
Link Layer
Introduction and services (review)
Error detection and correction
Multiple access protocols
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 4
Link Layer ReviewSome terminology hosts and routers are nodes communication channels
that connect adjacent nodes along communication path are links wired links wireless links LANs
layer-2 packet is a frame encapsulates datagram
ldquolinkrdquo
data-link layer has responsibility of transferring datagram from one node to adjacent node over a link
CPSC 441 Link Layer 5
Link layer Review
Datagram transferred by different link protocols over different links eg Ethernet on first link frame relay on intermediate
links 80211 on last link
Each link protocol provides different services eg may or may not provide reliable data transfer over
link
CPSC 441 Link Layer 6
Link Layer Services Review Framing link access
Reliable delivery between adjacent nodes
Flow Control
Error Detection
Error Correction
Half-duplex and full-duplex
CPSC 441 Link Layer 7
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 8
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction
CPSC 441 Link Layer 9
Parity Checking
Single Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
CPSC 441 Link Layer 10
Cyclic Redundancy CheckPolynomial Codes
A (n+1)-bit message can be represented as a polynomial of degree n For example X = 10011010 M(X) =
So a sender and receiver can be considered to exchange polyns
Choose k+1 bit pattern (divisor) C(X) a polyn of degree k
goal choose k CRC bits R such that ltMRgt exactly divisible by C (modulo 2) receiver knows C divides ltMRgt by C If non-zero
remainder error detected can detect all burst errors less than k+1 bits
xxxx 347
CPSC 441 Link Layer 11
CRC continued hellip
Goal design P(X) such that it is exactly divisible by C(X)
Multiply M(X) by xk (add k zerorsquos to the end of the message) to get T(X)
Divide T(X) by C(X) and find the remainder R(X) Subtract the remainder from T(X) to get P(X)
P(X) is now exactly divisible by C(X)
Remember ndash all additionsubtract use modulo-2 arithmetic
CPSC 441 Link Layer 12
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 13
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) traditional Ethernet upstream HFC 80211 wireless LAN
CPSC 441 Link Layer 14
When are Multiple Access Protocols Required
single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time (examples LANs Wireless-LANs)
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 4
Link Layer ReviewSome terminology hosts and routers are nodes communication channels
that connect adjacent nodes along communication path are links wired links wireless links LANs
layer-2 packet is a frame encapsulates datagram
ldquolinkrdquo
data-link layer has responsibility of transferring datagram from one node to adjacent node over a link
CPSC 441 Link Layer 5
Link layer Review
Datagram transferred by different link protocols over different links eg Ethernet on first link frame relay on intermediate
links 80211 on last link
Each link protocol provides different services eg may or may not provide reliable data transfer over
link
CPSC 441 Link Layer 6
Link Layer Services Review Framing link access
Reliable delivery between adjacent nodes
Flow Control
Error Detection
Error Correction
Half-duplex and full-duplex
CPSC 441 Link Layer 7
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 8
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction
CPSC 441 Link Layer 9
Parity Checking
Single Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
CPSC 441 Link Layer 10
Cyclic Redundancy CheckPolynomial Codes
A (n+1)-bit message can be represented as a polynomial of degree n For example X = 10011010 M(X) =
So a sender and receiver can be considered to exchange polyns
Choose k+1 bit pattern (divisor) C(X) a polyn of degree k
goal choose k CRC bits R such that ltMRgt exactly divisible by C (modulo 2) receiver knows C divides ltMRgt by C If non-zero
remainder error detected can detect all burst errors less than k+1 bits
xxxx 347
CPSC 441 Link Layer 11
CRC continued hellip
Goal design P(X) such that it is exactly divisible by C(X)
Multiply M(X) by xk (add k zerorsquos to the end of the message) to get T(X)
Divide T(X) by C(X) and find the remainder R(X) Subtract the remainder from T(X) to get P(X)
P(X) is now exactly divisible by C(X)
Remember ndash all additionsubtract use modulo-2 arithmetic
CPSC 441 Link Layer 12
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 13
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) traditional Ethernet upstream HFC 80211 wireless LAN
CPSC 441 Link Layer 14
When are Multiple Access Protocols Required
single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time (examples LANs Wireless-LANs)
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 5
Link layer Review
Datagram transferred by different link protocols over different links eg Ethernet on first link frame relay on intermediate
links 80211 on last link
Each link protocol provides different services eg may or may not provide reliable data transfer over
link
CPSC 441 Link Layer 6
Link Layer Services Review Framing link access
Reliable delivery between adjacent nodes
Flow Control
Error Detection
Error Correction
Half-duplex and full-duplex
CPSC 441 Link Layer 7
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 8
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction
CPSC 441 Link Layer 9
Parity Checking
Single Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
CPSC 441 Link Layer 10
Cyclic Redundancy CheckPolynomial Codes
A (n+1)-bit message can be represented as a polynomial of degree n For example X = 10011010 M(X) =
So a sender and receiver can be considered to exchange polyns
Choose k+1 bit pattern (divisor) C(X) a polyn of degree k
goal choose k CRC bits R such that ltMRgt exactly divisible by C (modulo 2) receiver knows C divides ltMRgt by C If non-zero
remainder error detected can detect all burst errors less than k+1 bits
xxxx 347
CPSC 441 Link Layer 11
CRC continued hellip
Goal design P(X) such that it is exactly divisible by C(X)
Multiply M(X) by xk (add k zerorsquos to the end of the message) to get T(X)
Divide T(X) by C(X) and find the remainder R(X) Subtract the remainder from T(X) to get P(X)
P(X) is now exactly divisible by C(X)
Remember ndash all additionsubtract use modulo-2 arithmetic
CPSC 441 Link Layer 12
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 13
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) traditional Ethernet upstream HFC 80211 wireless LAN
CPSC 441 Link Layer 14
When are Multiple Access Protocols Required
single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time (examples LANs Wireless-LANs)
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 6
Link Layer Services Review Framing link access
Reliable delivery between adjacent nodes
Flow Control
Error Detection
Error Correction
Half-duplex and full-duplex
CPSC 441 Link Layer 7
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 8
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction
CPSC 441 Link Layer 9
Parity Checking
Single Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
CPSC 441 Link Layer 10
Cyclic Redundancy CheckPolynomial Codes
A (n+1)-bit message can be represented as a polynomial of degree n For example X = 10011010 M(X) =
So a sender and receiver can be considered to exchange polyns
Choose k+1 bit pattern (divisor) C(X) a polyn of degree k
goal choose k CRC bits R such that ltMRgt exactly divisible by C (modulo 2) receiver knows C divides ltMRgt by C If non-zero
remainder error detected can detect all burst errors less than k+1 bits
xxxx 347
CPSC 441 Link Layer 11
CRC continued hellip
Goal design P(X) such that it is exactly divisible by C(X)
Multiply M(X) by xk (add k zerorsquos to the end of the message) to get T(X)
Divide T(X) by C(X) and find the remainder R(X) Subtract the remainder from T(X) to get P(X)
P(X) is now exactly divisible by C(X)
Remember ndash all additionsubtract use modulo-2 arithmetic
CPSC 441 Link Layer 12
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 13
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) traditional Ethernet upstream HFC 80211 wireless LAN
CPSC 441 Link Layer 14
When are Multiple Access Protocols Required
single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time (examples LANs Wireless-LANs)
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 7
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 8
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction
CPSC 441 Link Layer 9
Parity Checking
Single Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
CPSC 441 Link Layer 10
Cyclic Redundancy CheckPolynomial Codes
A (n+1)-bit message can be represented as a polynomial of degree n For example X = 10011010 M(X) =
So a sender and receiver can be considered to exchange polyns
Choose k+1 bit pattern (divisor) C(X) a polyn of degree k
goal choose k CRC bits R such that ltMRgt exactly divisible by C (modulo 2) receiver knows C divides ltMRgt by C If non-zero
remainder error detected can detect all burst errors less than k+1 bits
xxxx 347
CPSC 441 Link Layer 11
CRC continued hellip
Goal design P(X) such that it is exactly divisible by C(X)
Multiply M(X) by xk (add k zerorsquos to the end of the message) to get T(X)
Divide T(X) by C(X) and find the remainder R(X) Subtract the remainder from T(X) to get P(X)
P(X) is now exactly divisible by C(X)
Remember ndash all additionsubtract use modulo-2 arithmetic
CPSC 441 Link Layer 12
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 13
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) traditional Ethernet upstream HFC 80211 wireless LAN
CPSC 441 Link Layer 14
When are Multiple Access Protocols Required
single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time (examples LANs Wireless-LANs)
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 8
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking may include header fields
bull Error detection not 100 reliablebull protocol may miss some errors but rarelybull larger EDC field yields better detection and correction
CPSC 441 Link Layer 9
Parity Checking
Single Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
CPSC 441 Link Layer 10
Cyclic Redundancy CheckPolynomial Codes
A (n+1)-bit message can be represented as a polynomial of degree n For example X = 10011010 M(X) =
So a sender and receiver can be considered to exchange polyns
Choose k+1 bit pattern (divisor) C(X) a polyn of degree k
goal choose k CRC bits R such that ltMRgt exactly divisible by C (modulo 2) receiver knows C divides ltMRgt by C If non-zero
remainder error detected can detect all burst errors less than k+1 bits
xxxx 347
CPSC 441 Link Layer 11
CRC continued hellip
Goal design P(X) such that it is exactly divisible by C(X)
Multiply M(X) by xk (add k zerorsquos to the end of the message) to get T(X)
Divide T(X) by C(X) and find the remainder R(X) Subtract the remainder from T(X) to get P(X)
P(X) is now exactly divisible by C(X)
Remember ndash all additionsubtract use modulo-2 arithmetic
CPSC 441 Link Layer 12
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 13
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) traditional Ethernet upstream HFC 80211 wireless LAN
CPSC 441 Link Layer 14
When are Multiple Access Protocols Required
single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time (examples LANs Wireless-LANs)
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 9
Parity Checking
Single Bit ParityDetect single bit errors
Two Dimensional Bit ParityDetect and correct single bit errors
0 0
CPSC 441 Link Layer 10
Cyclic Redundancy CheckPolynomial Codes
A (n+1)-bit message can be represented as a polynomial of degree n For example X = 10011010 M(X) =
So a sender and receiver can be considered to exchange polyns
Choose k+1 bit pattern (divisor) C(X) a polyn of degree k
goal choose k CRC bits R such that ltMRgt exactly divisible by C (modulo 2) receiver knows C divides ltMRgt by C If non-zero
remainder error detected can detect all burst errors less than k+1 bits
xxxx 347
CPSC 441 Link Layer 11
CRC continued hellip
Goal design P(X) such that it is exactly divisible by C(X)
Multiply M(X) by xk (add k zerorsquos to the end of the message) to get T(X)
Divide T(X) by C(X) and find the remainder R(X) Subtract the remainder from T(X) to get P(X)
P(X) is now exactly divisible by C(X)
Remember ndash all additionsubtract use modulo-2 arithmetic
CPSC 441 Link Layer 12
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 13
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) traditional Ethernet upstream HFC 80211 wireless LAN
CPSC 441 Link Layer 14
When are Multiple Access Protocols Required
single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time (examples LANs Wireless-LANs)
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 10
Cyclic Redundancy CheckPolynomial Codes
A (n+1)-bit message can be represented as a polynomial of degree n For example X = 10011010 M(X) =
So a sender and receiver can be considered to exchange polyns
Choose k+1 bit pattern (divisor) C(X) a polyn of degree k
goal choose k CRC bits R such that ltMRgt exactly divisible by C (modulo 2) receiver knows C divides ltMRgt by C If non-zero
remainder error detected can detect all burst errors less than k+1 bits
xxxx 347
CPSC 441 Link Layer 11
CRC continued hellip
Goal design P(X) such that it is exactly divisible by C(X)
Multiply M(X) by xk (add k zerorsquos to the end of the message) to get T(X)
Divide T(X) by C(X) and find the remainder R(X) Subtract the remainder from T(X) to get P(X)
P(X) is now exactly divisible by C(X)
Remember ndash all additionsubtract use modulo-2 arithmetic
CPSC 441 Link Layer 12
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 13
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) traditional Ethernet upstream HFC 80211 wireless LAN
CPSC 441 Link Layer 14
When are Multiple Access Protocols Required
single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time (examples LANs Wireless-LANs)
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 11
CRC continued hellip
Goal design P(X) such that it is exactly divisible by C(X)
Multiply M(X) by xk (add k zerorsquos to the end of the message) to get T(X)
Divide T(X) by C(X) and find the remainder R(X) Subtract the remainder from T(X) to get P(X)
P(X) is now exactly divisible by C(X)
Remember ndash all additionsubtract use modulo-2 arithmetic
CPSC 441 Link Layer 12
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 13
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) traditional Ethernet upstream HFC 80211 wireless LAN
CPSC 441 Link Layer 14
When are Multiple Access Protocols Required
single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time (examples LANs Wireless-LANs)
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 12
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 13
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) traditional Ethernet upstream HFC 80211 wireless LAN
CPSC 441 Link Layer 14
When are Multiple Access Protocols Required
single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time (examples LANs Wireless-LANs)
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 13
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) traditional Ethernet upstream HFC 80211 wireless LAN
CPSC 441 Link Layer 14
When are Multiple Access Protocols Required
single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time (examples LANs Wireless-LANs)
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 14
When are Multiple Access Protocols Required
single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time (examples LANs Wireless-LANs)
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 15
Ideal Multiple Access Protocol
Broadcast channel of rate R bps1 When one node wants to transmit it can send
at rate R2 When M nodes want to transmit each can
send at average rate RM3 Fully decentralized
no special node to coordinate transmissions no synchronization of clocks slots
4 Simple and easy to implement
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 16
Taxonomy of Multiple Access Control Protocols
Three broad classes Channel Partitioning
divide channel into smaller ldquopiecesrdquo (TDM FDM Code Division Multiple Access) ndash TDM FDM covered in chap 1
allocate piece to node for exclusive use
Random Access channel not divided allow collisions ldquorecoverrdquo from collisions
ldquoTaking turnsrdquo Nodes take turns but nodes with more to send can
take longer turns
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 17
Random Access Protocols
When node has packet to send transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions)
Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 18
Pure ALOHA Let nodes transmit whenever a frame arrives No synchronization among nodes
If collision retransmit after random delay
collision probability increases frame sent at t0 collides with other frames sent in [t0-
1t0+1]
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 19
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
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 20
Slotted ALOHA
Assumptions all frames same size time is divided into
equal size slots time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized if 2 or more nodes
transmit in slot all nodes detect collision
Operation when node obtains fresh
frame it transmits in next slot
no collision node can send new frame in next slot
if collision node retransmits frame in each subsequent slot with prob p until success
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 21
Slotted ALOHA
Pros single active node can
continuously transmit at full rate of channel
highly decentralized only slots in nodes need to be in sync
simple
Cons collisions wasting
slots idle slots nodes may be able to
detect collision in less than time to transmit packet
clock synchronization
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 22
Slotted Aloha efficiency
Suppose N nodes with many frames to send each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
For max efficiency with N nodes find p that maximizes Np(1-p)N-1
For many nodes take limit of Np(1-p)N-1
as N goes to infinity gives 1e = 37
Efficiency is the long-run fraction of successful slots when there are many nodes each with many frames to send
At best channelused for useful transmissions 37of time
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 23
Carrier Sense Multiple Access (CSMA)
First listen transmit only if channel sensed to be idle
Can collisions occur in this scheme One possibility two nodes might attempt to transmit a
frame at the same time Another possibility
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 24
CSMACD (Collision Detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs receiver shut off while transmitting
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 25
ldquoTaking Turnsrdquo MAC protocolschannel partitioning MAC protocols
share channel efficiently and fairly at high load
inefficient at low load delay in channel access 1N bandwidth allocated even if only 1 active node
Random access MAC protocols efficient at low load single node can fully
utilize channel high load collision overhead
ldquotaking turnsrdquo protocolslook for best of both worlds
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 26
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master)
Token passing control token passed
from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 27
Summary of MAC protocols
What do you do with a shared media Channel Partitioning by time frequency or
codebull Time Division Frequency Division
Random partitioning (dynamic) bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)
hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211
Taking Turnsbull polling from a central site token passing
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 28
Next Stop LAN Technologies
Data link layer so far services error detectioncorrection multiple
access
Next LAN technologies Ethernet hubs switches PPP
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 29
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 30
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for 100Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 31
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices hub or switch (more later)
hub orswitch
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 32
Ethernet Frame Structure (12)Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet frame
Preamble 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 used to synchronize receiver sender clock
rates
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 33
Ethernet Frame Structure (22) Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to net-layer protocol
otherwise adapter discards frame
Type indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk)
CRC checked at receiver if error is detected the frame is simply dropped
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 34
Unreliable connectionless service Connectionless No handshaking between
sending and receiving adapter Unreliable receiving adapter doesnrsquot send
acks or nacks to sending adapter stream of datagrams passed to network layer can
have gaps gaps will be filled if app is using TCP otherwise app will see the gaps
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 35
Ethernet uses CSMACD
No slots adapter doesnrsquot
transmit if it senses that some other adapter is transmitting that is carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection
Before attempting a retransmission adapter waits a random time that is random access
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 36
Ethernet CSMACD algorithm
1 Adaptor receives datagram from net layer amp creates frame
2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits
3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame
4 If adapter detects another transmission while transmitting aborts and sends jam signal
5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 37
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 Goal adapt retransmission
attempts to estimated current load heavy load random wait
will be longer first collision choose K
from 01 delay is K 512 bit transmission times
after second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Seeinteract with Javaapplet on AWL Web sitehighly recommended
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 38
CSMACD efficiency tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity Much better than ALOHA but still decentralized simple and cheap
transprop tt 51
1efficiency
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 39
10BaseT and 100BaseT 10100 Mbps rate latter called ldquofast ethernetrdquo T stands for Twisted Pair Nodes connect to a hub ldquostar topologyrdquo 100
m max distance between nodes and hub
twisted pair
hub
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 40
HubsHubs are essentially physical-layer repeaters
bits coming from one link go out all other links at the same rate no frame buffering no CSMACD at hub adapters detect collisions provides net management functionality
twisted pair
hub
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 41
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Interconnections Hubs and switches
PPP MPLS
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 42
Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Canrsquot interconnect 10BaseT amp 100BaseT
hub
hubhub
hub
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 43
Switch Link layer device
stores and forwards Ethernet frames examines frame header and selectively forwards
frame based on MAC dest address when frame is to be forwarded on segment uses
CSMACD to access segment transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 44
Forwarding
bull How do determine onto which LAN segment to forward framebull Looks like a routing problem
hub
hubhub
switch1
2 3
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 45
Self learning
A switch has a switch table entry in switch table
(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60
min) switch learns which hosts can be reached through
which interfaces when frame received switch ldquolearnsrdquo location
of sender incoming LAN segment records senderlocation pair in switch table
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 46
FilteringForwardingWhen switch receives a frame
index switch table using MAC dest addressif 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
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 47
Switch traffic isolation switch installation breaks subnet into LAN
segments switch filters packets
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 48
Switches dedicated access Switch with many
interfaces Hosts have direct
connection to switch No collisions full duplex
Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions
switch
A
Arsquo
B
Brsquo
C
Crsquo
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 49
Switching types
cut-through switching frame forwarded from input to output port without first collecting entire frameslight reduction in latencyDisadvantage
Store-and-forward combinations of shareddedicated
101001000 Mbps interfaces
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 50
Institutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 51
Switches vs Routers both store-and-forward devices
routers network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 52
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP (self-study) MPLS (self-study)
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 53
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control (Data link
used to be considered ldquohigh layerrdquo in protocol stack
This is your READING assignment
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 54
Link Layer
Introduction and services
Error detection and correction
Multiple access protocols
Link-Layer Addressing
Ethernet
Hubs and switches PPP MPLS
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 55
Multi-Protocol Label Switching (MPLS)
initial goal speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address
PPP or Ethernet header
IP header remainder of link-layer frameMPLS header
label Exp S TTL
20 3 1 5
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 56
MPLS capable routers
aka label-switched router forwards packets to outgoing interface based
only on label value (donrsquot inspect IP address) MPLS forwarding table distinct from IP forwarding
tables signaling protocol needed to set up forwarding
RSVP-TE forwarding possible along paths that IP alone would
not allow (eg source-specific routing) use MPLS for traffic engineering
must co-exist with IP-only routers
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables
CPSC 441 Link Layer 57
R1R2
D
R3R4R5
0
1
00
A
R6
in out outlabel label dest interface 6 - A 0
in out outlabel label dest interface10 6 A 1
12 9 D 0
in out outlabel label dest interface 10 A 0
12 D 0
1
in out outlabel label dest interface 8 6 A 0
0
8 A 1
MPLS forwarding tables