Lecture 22
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Chapter 5Link Layer
Computer Networking A Top Down Approach 6th edition Jim Kurose Keith RossAddison-WesleyMarch 2012
A note on the use of these ppt slidesWersquore making these slides freely available to all (faculty students readers) Theyrsquore in PowerPoint form so you see the animations and can add modify and delete slides (including this one) and slide content to suit your needs They obviously represent a lot of work on our part In return for use we only ask the following If you use these slides (eg in a class) that you mention their source
(after all wersquod like people to use our book) If you post any slides on a www site that you note that they are adapted
from (or perhaps identical to) our slides and note our copyright of this material
Thanks and enjoy JFKKWR
All material copyright 1996-2012 JF Kurose and KW Ross All Rights Reserved
Link Layer 5-2
The Data Link LayerOur goals understand principles behind data link layer
services link layer addressing sharing a broadcast channel multiple access reliable data transfer error detection correction
Understanding various link layer technologies Ethernet (wired domain) Hubs Switches Bridges Differences with Routers Wi-Fi (wireless domain)
Link Layer IntroductionSome terminology hosts and routers are nodes communication channels
that connect adjacent nodes along communication path are links wired links wireless links
layer-2 packet is a frame encapsulates datagram
data-link layer has responsibility of transferring datagram from one node to adjacent node over a link
Link Layer Services framing link access
encapsulate datagram into frame adding header trailer
channel access if shared medium ldquoMACrdquo addresses used in frame headers to identify
source dest different from IP address
reliable delivery between adjacent nodesQ why both link-level and end-end
reliability
Link Layer Services (more)
flow control pacing between adjacent sending and receiving
nodes error detection
errors caused by signal attenuation noise receiver detects presence of errors
signals sender for retransmission or drops frame error correction
receiver identifies and corrects bit error(s) without resorting to retransmission
Where is the link layer implemented
in each and every host link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC) Ethernet card 80211
card implements link
physical layer attaches into hostrsquos
system buses combination of
hardware software firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
MAC Addresses
There are two types of addresses
32-bit IP address network-layer address used to get datagram to destination IP subnet
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
burned in NIC ROM also sometimes software settable
MAC Addresses MAC (or LAN or physical or Ethernet) address
48 bit MAC address
MAC AddressesEach adapter on LAN has unique MAC address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Which ones are globally unique and which ones are locally administered
Locally administered
ARP
Link Layer 5-11
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table
ARP table IPMAC address mappings for some LAN nodes
lt IP address MAC addressgt
Timeout time after which address mapping will be forgotten (Varies from vendor to vendor device to device)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
ARP Address Resolution Protocol
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
arp -a arp -s arp -d
ARP protocol Same LAN (network) A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Chapter 5Link Layer
Computer Networking A Top Down Approach 6th edition Jim Kurose Keith RossAddison-WesleyMarch 2012
A note on the use of these ppt slidesWersquore making these slides freely available to all (faculty students readers) Theyrsquore in PowerPoint form so you see the animations and can add modify and delete slides (including this one) and slide content to suit your needs They obviously represent a lot of work on our part In return for use we only ask the following If you use these slides (eg in a class) that you mention their source
(after all wersquod like people to use our book) If you post any slides on a www site that you note that they are adapted
from (or perhaps identical to) our slides and note our copyright of this material
Thanks and enjoy JFKKWR
All material copyright 1996-2012 JF Kurose and KW Ross All Rights Reserved
Link Layer 5-2
The Data Link LayerOur goals understand principles behind data link layer
services link layer addressing sharing a broadcast channel multiple access reliable data transfer error detection correction
Understanding various link layer technologies Ethernet (wired domain) Hubs Switches Bridges Differences with Routers Wi-Fi (wireless domain)
Link Layer IntroductionSome terminology hosts and routers are nodes communication channels
that connect adjacent nodes along communication path are links wired links wireless links
layer-2 packet is a frame encapsulates datagram
data-link layer has responsibility of transferring datagram from one node to adjacent node over a link
Link Layer Services framing link access
encapsulate datagram into frame adding header trailer
channel access if shared medium ldquoMACrdquo addresses used in frame headers to identify
source dest different from IP address
reliable delivery between adjacent nodesQ why both link-level and end-end
reliability
Link Layer Services (more)
flow control pacing between adjacent sending and receiving
nodes error detection
errors caused by signal attenuation noise receiver detects presence of errors
signals sender for retransmission or drops frame error correction
receiver identifies and corrects bit error(s) without resorting to retransmission
Where is the link layer implemented
in each and every host link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC) Ethernet card 80211
card implements link
physical layer attaches into hostrsquos
system buses combination of
hardware software firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
MAC Addresses
There are two types of addresses
32-bit IP address network-layer address used to get datagram to destination IP subnet
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
burned in NIC ROM also sometimes software settable
MAC Addresses MAC (or LAN or physical or Ethernet) address
48 bit MAC address
MAC AddressesEach adapter on LAN has unique MAC address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Which ones are globally unique and which ones are locally administered
Locally administered
ARP
Link Layer 5-11
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table
ARP table IPMAC address mappings for some LAN nodes
lt IP address MAC addressgt
Timeout time after which address mapping will be forgotten (Varies from vendor to vendor device to device)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
ARP Address Resolution Protocol
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
arp -a arp -s arp -d
ARP protocol Same LAN (network) A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
The Data Link LayerOur goals understand principles behind data link layer
services link layer addressing sharing a broadcast channel multiple access reliable data transfer error detection correction
Understanding various link layer technologies Ethernet (wired domain) Hubs Switches Bridges Differences with Routers Wi-Fi (wireless domain)
Link Layer IntroductionSome terminology hosts and routers are nodes communication channels
that connect adjacent nodes along communication path are links wired links wireless links
layer-2 packet is a frame encapsulates datagram
data-link layer has responsibility of transferring datagram from one node to adjacent node over a link
Link Layer Services framing link access
encapsulate datagram into frame adding header trailer
channel access if shared medium ldquoMACrdquo addresses used in frame headers to identify
source dest different from IP address
reliable delivery between adjacent nodesQ why both link-level and end-end
reliability
Link Layer Services (more)
flow control pacing between adjacent sending and receiving
nodes error detection
errors caused by signal attenuation noise receiver detects presence of errors
signals sender for retransmission or drops frame error correction
receiver identifies and corrects bit error(s) without resorting to retransmission
Where is the link layer implemented
in each and every host link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC) Ethernet card 80211
card implements link
physical layer attaches into hostrsquos
system buses combination of
hardware software firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
MAC Addresses
There are two types of addresses
32-bit IP address network-layer address used to get datagram to destination IP subnet
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
burned in NIC ROM also sometimes software settable
MAC Addresses MAC (or LAN or physical or Ethernet) address
48 bit MAC address
MAC AddressesEach adapter on LAN has unique MAC address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Which ones are globally unique and which ones are locally administered
Locally administered
ARP
Link Layer 5-11
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table
ARP table IPMAC address mappings for some LAN nodes
lt IP address MAC addressgt
Timeout time after which address mapping will be forgotten (Varies from vendor to vendor device to device)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
ARP Address Resolution Protocol
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
arp -a arp -s arp -d
ARP protocol Same LAN (network) A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Link Layer IntroductionSome terminology hosts and routers are nodes communication channels
that connect adjacent nodes along communication path are links wired links wireless links
layer-2 packet is a frame encapsulates datagram
data-link layer has responsibility of transferring datagram from one node to adjacent node over a link
Link Layer Services framing link access
encapsulate datagram into frame adding header trailer
channel access if shared medium ldquoMACrdquo addresses used in frame headers to identify
source dest different from IP address
reliable delivery between adjacent nodesQ why both link-level and end-end
reliability
Link Layer Services (more)
flow control pacing between adjacent sending and receiving
nodes error detection
errors caused by signal attenuation noise receiver detects presence of errors
signals sender for retransmission or drops frame error correction
receiver identifies and corrects bit error(s) without resorting to retransmission
Where is the link layer implemented
in each and every host link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC) Ethernet card 80211
card implements link
physical layer attaches into hostrsquos
system buses combination of
hardware software firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
MAC Addresses
There are two types of addresses
32-bit IP address network-layer address used to get datagram to destination IP subnet
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
burned in NIC ROM also sometimes software settable
MAC Addresses MAC (or LAN or physical or Ethernet) address
48 bit MAC address
MAC AddressesEach adapter on LAN has unique MAC address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Which ones are globally unique and which ones are locally administered
Locally administered
ARP
Link Layer 5-11
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table
ARP table IPMAC address mappings for some LAN nodes
lt IP address MAC addressgt
Timeout time after which address mapping will be forgotten (Varies from vendor to vendor device to device)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
ARP Address Resolution Protocol
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
arp -a arp -s arp -d
ARP protocol Same LAN (network) A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Link Layer Services framing link access
encapsulate datagram into frame adding header trailer
channel access if shared medium ldquoMACrdquo addresses used in frame headers to identify
source dest different from IP address
reliable delivery between adjacent nodesQ why both link-level and end-end
reliability
Link Layer Services (more)
flow control pacing between adjacent sending and receiving
nodes error detection
errors caused by signal attenuation noise receiver detects presence of errors
signals sender for retransmission or drops frame error correction
receiver identifies and corrects bit error(s) without resorting to retransmission
Where is the link layer implemented
in each and every host link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC) Ethernet card 80211
card implements link
physical layer attaches into hostrsquos
system buses combination of
hardware software firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
MAC Addresses
There are two types of addresses
32-bit IP address network-layer address used to get datagram to destination IP subnet
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
burned in NIC ROM also sometimes software settable
MAC Addresses MAC (or LAN or physical or Ethernet) address
48 bit MAC address
MAC AddressesEach adapter on LAN has unique MAC address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Which ones are globally unique and which ones are locally administered
Locally administered
ARP
Link Layer 5-11
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table
ARP table IPMAC address mappings for some LAN nodes
lt IP address MAC addressgt
Timeout time after which address mapping will be forgotten (Varies from vendor to vendor device to device)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
ARP Address Resolution Protocol
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
arp -a arp -s arp -d
ARP protocol Same LAN (network) A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Link Layer Services (more)
flow control pacing between adjacent sending and receiving
nodes error detection
errors caused by signal attenuation noise receiver detects presence of errors
signals sender for retransmission or drops frame error correction
receiver identifies and corrects bit error(s) without resorting to retransmission
Where is the link layer implemented
in each and every host link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC) Ethernet card 80211
card implements link
physical layer attaches into hostrsquos
system buses combination of
hardware software firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
MAC Addresses
There are two types of addresses
32-bit IP address network-layer address used to get datagram to destination IP subnet
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
burned in NIC ROM also sometimes software settable
MAC Addresses MAC (or LAN or physical or Ethernet) address
48 bit MAC address
MAC AddressesEach adapter on LAN has unique MAC address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Which ones are globally unique and which ones are locally administered
Locally administered
ARP
Link Layer 5-11
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table
ARP table IPMAC address mappings for some LAN nodes
lt IP address MAC addressgt
Timeout time after which address mapping will be forgotten (Varies from vendor to vendor device to device)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
ARP Address Resolution Protocol
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
arp -a arp -s arp -d
ARP protocol Same LAN (network) A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Where is the link layer implemented
in each and every host link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC) Ethernet card 80211
card implements link
physical layer attaches into hostrsquos
system buses combination of
hardware software firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
MAC Addresses
There are two types of addresses
32-bit IP address network-layer address used to get datagram to destination IP subnet
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
burned in NIC ROM also sometimes software settable
MAC Addresses MAC (or LAN or physical or Ethernet) address
48 bit MAC address
MAC AddressesEach adapter on LAN has unique MAC address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Which ones are globally unique and which ones are locally administered
Locally administered
ARP
Link Layer 5-11
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table
ARP table IPMAC address mappings for some LAN nodes
lt IP address MAC addressgt
Timeout time after which address mapping will be forgotten (Varies from vendor to vendor device to device)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
ARP Address Resolution Protocol
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
arp -a arp -s arp -d
ARP protocol Same LAN (network) A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
MAC Addresses
There are two types of addresses
32-bit IP address network-layer address used to get datagram to destination IP subnet
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
burned in NIC ROM also sometimes software settable
MAC Addresses MAC (or LAN or physical or Ethernet) address
48 bit MAC address
MAC AddressesEach adapter on LAN has unique MAC address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Which ones are globally unique and which ones are locally administered
Locally administered
ARP
Link Layer 5-11
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table
ARP table IPMAC address mappings for some LAN nodes
lt IP address MAC addressgt
Timeout time after which address mapping will be forgotten (Varies from vendor to vendor device to device)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
ARP Address Resolution Protocol
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
arp -a arp -s arp -d
ARP protocol Same LAN (network) A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
MAC Addresses MAC (or LAN or physical or Ethernet) address
48 bit MAC address
MAC AddressesEach adapter on LAN has unique MAC address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Which ones are globally unique and which ones are locally administered
Locally administered
ARP
Link Layer 5-11
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table
ARP table IPMAC address mappings for some LAN nodes
lt IP address MAC addressgt
Timeout time after which address mapping will be forgotten (Varies from vendor to vendor device to device)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
ARP Address Resolution Protocol
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
arp -a arp -s arp -d
ARP protocol Same LAN (network) A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
MAC AddressesEach adapter on LAN has unique MAC address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Which ones are globally unique and which ones are locally administered
Locally administered
ARP
Link Layer 5-11
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table
ARP table IPMAC address mappings for some LAN nodes
lt IP address MAC addressgt
Timeout time after which address mapping will be forgotten (Varies from vendor to vendor device to device)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
ARP Address Resolution Protocol
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
arp -a arp -s arp -d
ARP protocol Same LAN (network) A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
ARP
Link Layer 5-11
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table
ARP table IPMAC address mappings for some LAN nodes
lt IP address MAC addressgt
Timeout time after which address mapping will be forgotten (Varies from vendor to vendor device to device)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
ARP Address Resolution Protocol
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
arp -a arp -s arp -d
ARP protocol Same LAN (network) A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table
ARP table IPMAC address mappings for some LAN nodes
lt IP address MAC addressgt
Timeout time after which address mapping will be forgotten (Varies from vendor to vendor device to device)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
ARP Address Resolution Protocol
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
arp -a arp -s arp -d
ARP protocol Same LAN (network) A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
ARP Address Resolution Protocol
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
arp -a arp -s arp -d
ARP protocol Same LAN (network) A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
ARP protocol Same LAN (network) A wants to send
datagram to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Addressing routing to another LAN
R
1A-23-F9-CD-06-9B
222222222220111111111110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111111111112
111111111111
A74-29-9C-E8-FF-55
222222222221
88-B2-2F-54-1A-0F
B222222222222
49-BD-D2-C7-56-2A
Proxy-ARP walkthrough send datagram from A to B via R
assume A knows Brsquos IP address
two ARP tables in router R one for each IP network (LAN)
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-16
Addressing routing to another LAN
IPEthPhy
IP src 111111111111 IP dest 222222222222
A creates IP datagram with IP source A destination B A creates link-layer frame with Rs MAC address
as dest frame contains A-to-B IP datagram
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-17
Addressing routing to another LAN
IPEthPhy
frame sent from A to R
IPEthPhy
frame received at R datagram removed passed up to IP
MAC src 74-29-9C-E8-FF-55 MAC dest E6-E9-00-17-BB-4B
IP src 111111111111 IP dest 222222222222
IP src 111111111111 IP dest 222222222222
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-18
Addressing routing to another LAN
IP src 111111111111 IP dest 222222222222
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-19
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
IPEthPhy
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
R
1A-23-F9-CD-06-9B222222222220
111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111111111112
11111111111174-29-9C-E8-FF-55
A
22222222222249-BD-D2-C7-56-2A
22222222222188-B2-2F-54-1A-0F
B
Link Layer 5-20
Addressing routing to another LAN
R forwards datagram with IP source A destination B R creates link-layer frame with Bs MAC address as dest
frame contains A-to-B IP datagram
IP src 111111111111 IP dest 222222222222
MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A
IPEthPhy
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Understanding the competition for medium
(channel) access
Protocols for Medium Access Control (MAC)
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Multiple Access Links and Protocols
Two types of ldquolinksrdquo broadcast (shared wire or medium)
Ethernet 80211 wireless LAN
point-to-point point-to-point link between switchesBridges and
hosts
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Multiple Access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at the same
time
multiple access 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
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Ideal Multiple Access Protocol
What are the multiple access protocols
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Channel Partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length =
pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots
256 idle
1 3 4 1 3 4
6-slotframe
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Channel Partitioning MAC protocols FDMA
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
frequ
ency
bands time
FDM cable
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
typically used with ldquodumbrdquo slave devices
concerns1 polling overhead 2 latency3 single point of
failure (master)
master
slaves
poll
data
data
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
ldquoTaking Turnsrdquo MAC protocolsToken ring control token
passed from one node to next sequentially
token message concerns
token overhead latency single point of failure
(token)
T
data
(nothingto send)
T
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Concerns with Ideal protocols Conservative Too much overhead wasted Not flexible dynamic If one user has nothing to send that ldquoslot
rdquo is wasted
Internet is all about dynamichellipwhy not make MAC protocol dynamic in nature
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
MAC 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
Ethernet (IEEE 8023) Wi-Fi (IEEE 80211)
Based on the principle of reducing collisions
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
CSMACD (Collision Detection) CSMACD carrier sensing collision detection
collisions detected within short timecolliding transmissions aborted reducing channel
wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Ethernet
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Ethernetldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Link Layer 5-35
Ethernet physical topology bus popular through mid 90s
all nodes in same collision domain bull can collide with each other
star prevails today active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol
bull nodes do not collide with each other
switch
bus coaxial cable
star
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Link Layer 5-36
Ethernet frame structure
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
destaddress
sourceaddress
data (payload) CRCpreamble
type
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Link Layer 5-37
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses if adapter receives frame with matching destination
address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol
otherwise adapter discards frame type indicates higher layer protocol
IPV4 IPV6 ARP etc CRC cyclic redundancy check at receiver
error detected frame is dropped
destaddress
sourceaddress
data (payload) CRCpreamble
type
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Lecture 23
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Ethernet Unreliable connectionless connectionless No handshaking between sending
and receiving NICs unreliable receiving NIC doesnrsquot send acks or
nacks to sending NIC stream of datagrams passed to network layer can have
gaps (missing datagrams) gaps will be filled if app is using TCP otherwise app will see gaps
Ethernetrsquos MAC protocol unslotted CSMACD
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmissionIf NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts send a jam signal and prepare for retransmission
5 After collision NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K slot times returns to Step 2(1 slot = 512 bit times)
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Ethernetrsquos CSMACD (more)Jam Signal make sure all
other transmitters are aware of collision 48 bits
Bit time 1 microsec for 10 Mbps
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 timesafter second collision choose K from 0123hellip
after ten collisions choose K from 01234hellip1023
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Overview of physical devices in the LAN
Hubs Switches Bridges
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Hubshellip physical-layer (ldquodumbrdquo) repeaters
bits coming in one link go out all other links at same rate
all nodes connected to hub can collide with one another
no frame buffering no CSMACD at hub host NICs detect collisions
twisted pair
hub
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Switch link-layer device smarter than hubs take active role
store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD to access segment
transparent hosts are unaware of presence of switches
plug-and-play self-learning switches typically do not need to be configured
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Switch allows multiple simultaneous transmissions
hosts have dedicated direct connection to switch
switches buffer packets Ethernet protocol used on
each incoming link but no collisions each link is its own collision domain
Full duplex switching A-to-Arsquo and B-to-
Brsquo simultaneously without collisions not possible with ldquodumbrdquo hub
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Switch Table
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch maintains a switch table
each entry in the table holds MAC address of host interface to reach host time stamp
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Switch self-learning Q how are entries created
maintained in switch table
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
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Interconnecting switches switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to G via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Link Layer 5-50
Institutional network
to externalnetwork
router
mail server
web server
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Link Layer 5-51
Switches vs routers
both are store-and-forward routers network-layer devices
examine network-layer headers
switches link-layer devices examine link-layer headers
both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses
applicationtransportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetwork
linkphysical
frame
frame
frame
datagram
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Introduction to Bridges
Many times it is necessary to connect a local area network to another local area network
The LANs might be of different types Eg Ethernet LAN token ring LAN etc
Switches are not sufficient then
Local area network to local area network connections are often performed with a bridge
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
A bridge interconnecting two dissimilar LANs
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Bridges
A bridge can be used to connect two different LANs such as a CSMACD LAN and a token ring LAN
A bridge can also be used to connect two similar LANs such as two CSMACD LANs
Just like switch functionality
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Bridges (2)
Just like switch a bridge does not need programming but observes all traffic and builds routing tables from this observation
This observation is called backward learning
Each bridge has two connections (ports) and there is a routing table associated with each port
A bridge observes each frame that arrives at a port extracts the source address from the frame and places that address in the portrsquos routing table
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Bridges (3)
More importantly
A bridge can also convert one frame format to another
The bridge removes the headers and trailers from one frame format and inserts (encapsulates) the headers and trailers for the second frame format
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Data Communications and Computer Networks Chapter 8
Encapsulation
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Lecture 24
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
VLANS
Link Layer 5-59
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
VLANs motivation
consider CS user moves office to EE but
wants connect to CS switch single broadcast domain
all layer-2 broadcast traffic must cross entire LAN ARP DHCP unknown location
of destination MAC address
securityprivacy efficiency issues
Link Layer 5-60
Computer Science Electrical
Engineering
ComputerEngineering
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
VLANsport-based VLAN switch ports
grouped (by switch management software) so that single physical switch
Link Layer 5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over a single physical LAN infrastructure
Virtual Local Area Network
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
Electrical Engineering(VLAN ports 1-8)
hellip
1
82
7 9
1610
15
hellip
Computer Science(VLAN ports 9-16)
hellip operates as multiple virtual switches
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Port-based VLAN traffic isolation frames tofrom
ports 1-8 can only reach ports 1-8 can also define VLAN based on MAC
addresses of endpoints rather than switch port
Link Layer 5-62
1
8
9
16102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
dynamic membership ports can be dynamically assigned among VLANs
router
forwarding between VLANS done via routing (just as with separate switches) in practice vendors sell combined switches plus
routers
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
VLAN-aware switches
Commercial 8-port VLAN-aware switches ($30-$60)
Link Layer 5-63
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
VLANS spanning multiple switches
trunk port carries frames between VLANS defined over multiple physical switches frames forwarded within VLAN between switches
canrsquot be ordinary 8021 frames (must carry VLAN ID info)
8021q protocol addsremoved additional header fields for frames forwarded between trunk ports Link Layer 5-64
1
8
9
102
7
hellip
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
hellip
2
73
Ports 235 belong to EE VLANPorts 4678 belong to CS VLAN
5
4 6 816
1
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Link Layer 5-65
type
2-byte Tag Protocol Identifier (value 0x8100)
Tag Control Information (3 bit priority field like IP TOS
1 bit drop eligible indicator 12 bit VLAN ID field)
Recomputed CRC
8021Q VLAN frame format
8021 frame
8021Q frame
destaddress
sourceaddress data (payload) CRCpreamble
data (payload) CRC
type
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Link layer in wireless
Link Layer 5-66
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
link access in wireless domain wireless (mobile) phone subscribers
now exceeds wired phone subscribers
computer networks laptops palmtops PDAs Smart Phones promise anytime wireless Internet access
It has really been a wireless revolution decadehellipwith more to come Wireless is no longer a luxury but a
necessity
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
WLAN Market WiFi
0
1
2
3
4
5
$-b
il
2001 2002 2003 2004 2005
Forecast Sales of Wi-Fi Equipment(Source InfoTech Trends)
Source Pyramid Research
Worldwide WLAN Infrastructure Shipments (Source Gartner)
0
1
2
3
4
5
6
7
Mil
lio
ns o
f U
nit
s
Source AirTight Networks
WLAN growing exponentially
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
IEEE 80211 Wireless LAN 80211b
24 GHz unlicensed spectrum
up to 11 Mbps 80211g
24 GHz range up to 54 Mbps
80211a 5 GHz range up to 54 Mbps
80211n multiple antennae 24 5 GHz range up to 200 Mbps
all use CSMACA for multiple access all have infrastructure and ad-hoc network versions
What else 80211 ac ndash builds on 802n ndash provides 80-160MHz channels 80211ad ndash 60GHz mmwave spectrum 80211af ndash Super Wi-Fi
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
80211 LAN architecture
wireless host communicates with base station base station = access
point (AP) Basic Service Set (BSS)
(aka ldquocellrdquo) in infrastructure mode contains wireless hosts access point (AP) base
station ad hoc mode hosts
only
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Basic Service Set (BSS)
BSS
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Extended Service Set (ESS) BSSrsquos with wired Distribution System (DS)
BSS
BSS
Distribution
System
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
80211 Channels association 80211b 24GHz-2485GHz spectrum divided
into 13 channels at different frequencies AP admin chooses frequency for AP interference possible channel can be same
as that chosen by neighboring AP
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in
APrsquos subnet
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
IEEE 80211 multiple access problem 80211 CSMA - sense before transmitting
donrsquot collide with ongoing transmission by other node
Certain differences from Ethernet LAN in wired domain
80211 no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading)bull Signal strength falls off rapidly with distance bull Signal strength may weaken due to obstaclesbull Medium ldquoairrdquo shared among many users (not just WiFi users)
canrsquot detect all collisions in any case hidden terminal problem
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Wireless interference
Hidden terminal
Goal CSMAC(ollision)A(voidance)
ldquoOpenrdquo Wireless Medium
S1
S2
R1
R1
S1 R1 S2
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
How does the medium access work in WLAN
Access methods DCF CSMACA (mandatory)
bull collision avoidance via exponential backoffbull Minimum distance (IFS) between consecutive packetsbull ACK packet for acknowledgements (not for broadcasts)
DCF with RTSCTS (optional)
bull Distributed Foundation Wireless MACbull avoids hidden terminal problem
PCF (optional)
bull access point polls terminals according to a list
Contention Based
Contention Free
Distributed Coordination Function (DCF) Point Coordination Function (PCF)
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
80211 ndash MAC Priorities
defined through different inter frame spaces SIFS (Short Inter Frame Spacing)
bull highest priority for ACK CTS polling response PIFS (PCF IFS)
bull medium priority for time-bounded service using PCF
DIFS (DCF Distributed Coordination Function IFS)
bull lowest priority for asynchronous data service competing stations
t
medium busy SIFS
PIFS
DIFSDIFS
next framecontention
access if medium is free DIFS
DIFS = SIFS + (2 Slot time)
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Lecture 25
University of Nevada ndash RenoComputer Science amp Engineering Department
Fall 2015
CPE 400 600Computer Communication Networks
Prof Shamik SenguptaOffice SEM 204
ssenguptaunreduhttpwwwcseunredu~shamik
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
WLAN access scheme details
Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly automatic retransmission of data packets in case of
transmission errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Contention for channel When the other stations find the channel idle they
would like to transmit their own packets Contention for channel
If all the waiting stations attempt at once this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Backoff Interval When transmitting a packet choose a backoff interval in
the range [0cw] cw is contention window
Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy
When backoff interval reaches 0 transmit packet
data
wait
B1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
Assume cw = 31
B2 = 10
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Backoff Interval The time spent counting down backoff intervals is a part
of MAC overhead Choosing a large cw leads to large backoff intervals and
can result in larger overhead Choosing a small cw leads to a larger number of collisions
(when two nodes count down to 0 simultaneously)
Since the number of nodes attempting to transmit simultaneously may change with time some mechanism to manage contention is needed IEEE 80211 DCF contention window cw is chosen
dynamically depending on collision occurrence Follows Binary exponential backoff algorithm
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Binary Exponential Backoff (BEB) in DCF
Even before the first collision nodes follow BEB
Initial backoff interval (before 1st collision) [07]
If still packets collide double the collision interval [015] [031] and so onhellip
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Avoiding collisions (more)idea allow sender to ldquoreserverdquo channel rather than
random access of data frames avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but theyrsquore
short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes
sender transmits data frame other stations defer transmissions
avoid data frame collisions completely using small reservation packets
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Numerical Problems Practice
Wi-FiHidden Node ProblemWi-Fi with RTSCTS
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Wireless Mobile Networks 6-87
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
80211 frame addressing
Address 2 MAC addressof wireless host or AP transmitting this frame
Address 1 MAC addressof wireless host or AP to receive this frame
Address 3 MAC address(dependent on frame control field)
Address 4 used only in ad hoc mode
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Wireless Mobile Networks 6-88
InternetrouterH1 R1
AP MAC addr H1 MAC addr R1 MAC addr
address 1 address 2 address 3
80211 frame
R1 MAC addr H1 MAC addr
dest address source address
8023 frame
80211 frame addressing
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Wireless Mobile Networks 6-89
framecontrol
durationaddress
1address
2address
4address
3payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seqcontrol
TypeFromAP
SubtypeToAP
More frag
WEPMoredata
Powermgt
Retry RsvdProtocolversion
2 2 4 1 1 1 1 1 11 1
duration of reserved transmission time (RTSCTS)
frame seq (for RDT)
frame type(RTS CTS ACK data)
80211 frame more
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Frame Control field
Protocol Version zero for 80211 standard
Type= frame type data management control Subtype = frame sub-type
ToDS when bit is set indicate that destination
frame is for DS FromDS
When bit is set indicate frame coming from DS
Data Link Layer 5-90
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Frame Control field
Retry Set in case of retransmission frame
More fragments Set when frame is followed by other
fragment Power Management
bit set when station go Power Save mode (PS)
More Data When set means that AP have more
buffered data for a station in Power Save mode
Data Link Layer 5-91
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Address Field Description
Addr 1 = All stations filter on this addressAddr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame toAddr 3 = Dependent on To and From DS bitsAddr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
To DS
0
0
1
1
From DS
0
1
0
1
Address 1
DA
DA
BSSID
RA
Address 2
SA
BSSID
SA
TA
Address 3
BSSID
SA
DA
DA
Address 4
NA
NA
NA
SA
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Type field descriptions
Type and subtype identify the function of the frame Type=00 Management Frame
Beacon (Re)Association
Probe
Type=01 Control FrameRTSCTS ACK
Type=10 Data Frame
ProtocolVersion
Type SubTypeToDS
RetryPwrMgt
MoreData
WEP Rsvd
Frame Control Field
Bits 2 2 4 1 1 1 1 1 1 1 1
DSFrom More
Frag
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Type and subtypes
Data Link Layer 5-94
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Type and subtypes
Data Link Layer 5-95
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
Type and subtypes
Data Link Layer 5-96
RTSCTS frames
Data Link Layer 5-97
RTSCTS frames
Data Link Layer 5-97