Download as pdf or txt
Download as pdf or txt
You are on page 1of 100

Unit-5

The Link Layer, wireless and


mobile networks
our goals:
▪ understand principles behind link layer
services:
• error detection, correction
• sharing a broadcast channel: multiple access
• link layer addressing
• local area networks: Ethernet, VLANs
▪ instantiation, implementation of various link
layer technologies
Link layer: introduction
terminology:
▪ hosts and routers: nodes
▪ communication channels that
connect adjacent nodes along
communication path: links
• wired links
• wireless links
• LANs
▪ layer-2 packet: frame,
encapsulates datagram

data-link layer has responsibility of


transferring datagram from one node
to physically adjacent node over a link
Link layer: context
▪ datagram transferred by
different link protocols over ▪ tourist = datagram
different links: ▪ transport segment =
• e.g., Ethernet on first link, communication link
frame relay on ▪ transportation mode = link
intermediate links, layer protocol
802.11 on last link ▪ travel agent = routing
▪ each link protocol provides algorithm
different services
• e.g., may or may not
provide rdt over link
Link layer services
▪ framing, link access:
• encapsulate datagram into frame, adding header, trailer
• channel access if shared medium
• “MAC” addresses used in frame headers to identify
source, destination
• different from IP address!
▪ reliable delivery between adjacent nodes
• we learned how to do this already (chapter 3)!
• seldom used on low bit-error link (fiber, some twisted
pair)
• wireless links: high error rates
• Q: why both link-level and end-end reliability?
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
▪ half-duplex and full-duplex
• with half duplex, nodes at both ends of link can transmit, but not
at same time
Where is the link layer implemented?
▪ in each and every host
▪ link layer implemented in
“adaptor” (aka network
interface card NIC) or on a
chip applicatio
• Ethernet card, 802.11 n
transport cpu
memo

card; Ethernet chipset


ry
network
link
• implements link, physical host
layer control
ler
bus
(e.g., PCI)
▪ attaches into host’s system link
physica
buses l physical
transmissio

▪ combination of hardware,
n

software, firmware network


adapter
card
Adaptors communicating

datagra datagra
m m
controll controll
er er

sending receiving
host datagra host
m
fram
e

▪ sending side: ▪ receiving side


• encapsulates datagram • looks for errors, rdt,
in frame flow control, etc.
• adds error checking bits, • extracts datagram,
rdt, flow control, etc. passes to upper layer at
receiving side
Multiple access links, protocols
two types of “links”:
▪ point-to-point
• PPP for dial-up access
• point-to-point link between Ethernet switch, host
▪ broadcast (shared wire or medium)
• old-fashioned Ethernet
• upstream HFC
• 802.11 wireless LAN

shared wire (e.g., shared RF shared humans at a


(e.g., 802.11 WiFi) RF cocktail party
cabled Ethernet) (satellite) (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, i.e., determine when node can transmit
▪ communication about channel sharing must use channel itself!
• no out-of-band channel for coordination
An ideal multiple access protocol
given: broadcast channel of rate R bps
desiderata:
1. when one node wants to transmit, it can send at rate R.
2. when M nodes want to transmit, each can send at average
rate R/M
3. fully decentralized:
• no special node to coordinate transmissions
• no synchronization of clocks, slots
4. simple
MAC protocols: taxonomy
three broad classes:
▪ channel partitioning
• divide channel into smaller “pieces” (time slots, frequency, code)
• allocate piece to node for exclusive use
▪ random access
• channel not divided, allow collisions
• “recover” from collisions
▪ “taking turns”
• nodes take turns, but nodes with more to send can take longer
turns
Channel partitioning MAC protocols: TDMA
TDMA: time division multiple access
▪ access to channel in "rounds"
▪ each station gets fixed length slot (length =
packet transmission time) in each round
▪ unused slots go idle
▪ example: 6-station LAN, 1,3,4 have packets to
send, slots 2,5,6 idle

6-slot 6-slot
fram fram
e e
1 3 4 1 3 4
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, 1,3,4 have packet to send, frequency
bands 2,5,6 idle

tim
frequency e
bands

FDM
cable
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 ➜ “collision”,
▪ random access MAC protocol specifies:
• how to detect collisions
• how to recover from collisions (e.g., via delayed
retransmissions)
▪ examples of random access MAC protocols:
• slotted ALOHA
• ALOHA
• CSMA, CSMA/CD, CSMA/CA
Slotted ALOHA
assumptions: operation:
▪ all frames same size ▪ when node obtains fresh
▪ time divided into equal size frame, transmits in next slot
slots (time to transmit 1 • if no collision: node can
frame) send new frame in next
▪ nodes start to transmit slot
only slot beginning • if collision: node
▪ nodes are synchronized retransmits frame in each
▪ if 2 or more nodes subsequent slot with prob.
transmit in slot, all nodes p until success
detect collision
Slotted ALOHA
node 1 1 1 1
1
node 2 2 2
2
node 3 3 3
3
C E C S E C E S S

Pros: Cons:
▪ single active node can ▪ collisions, wasting slots
continuously transmit at ▪ idle slots
full rate of channel
▪ nodes may be able to
▪ highly decentralized: only detect collision in less
slots in nodes need to be than time to transmit
in sync
packet
▪ simple
▪ clock synchronization
Slotted ALOHA: efficiency

efficiency: long-run ▪ max efficiency: find p*


fraction of successful slots that maximizes
(many nodes, all with Np(1-p)N-1
many frames to send) ▪ for many nodes, take
limit of Np*(1-p*)N-1 as N
▪ suppose: N nodes with goes to infinity, gives:
many frames to send, max efficiency = 1/e = .37
each transmits in slot
with probability p

!
▪ prob that given node has at best: channel
success in a slot = p(1- used for useful
p)N-1 transmissions 37%
▪ prob that any node has a of time!
success = Np(1-p) N-1
Pure (unslotted) ALOHA
▪ unslotted Aloha: simpler, no synchronization
▪ when frame first arrives
• transmit immediately
▪ collision probability increases:
• frame sent at t0 collides with other frames sent in
[t0-1,t 0+1]
Pure ALOHA efficiency
P(success by given node) = P(node transmits) .
P(no other node transmits in [t 0-1,t 0] .
P(no other node transmits in [t 0-1,t 0]

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

… choosing optimum p and then letting n

= 1/(2e) = .18

even worse than slotted


Aloha!
CSMA (carrier sense multiple access)

CSMA: listen before transmit:


if channel sensed idle: transmit entire
frame
▪ if channel sensed busy, defer
transmission

▪ human analogy: don’t interrupt others!


CSMA collisions spatial layout of nodes

▪ collisions can still occur:


propagation delay
means two nodes may
not hear each other’s
transmission
▪ collision: entire packet
transmission time
wasted
• distance &
propagation delay
play role in in
determining collision
probability
CSMA/CD (collision detection)
CSMA/CD: carrier sensing, deferral as in CSMA
• collisions detected within short time
• colliding transmissions aborted, reducing channel wastage
▪ collision detection:
• easy in wired LANs: measure signal strengths, compare
transmitted, received signals
• difficult in wireless LANs: received signal strength
overwhelmed by local transmission strength
▪ human analogy: the polite conversationalist
CSMA/CD (collision detection)
spatial layout of nodes
Ethernet CSMA/CD algorithm
1. NIC receives datagram 4. If NIC detects another
from network layer, transmission while
creates frame transmitting, aborts and
2. If NIC senses channel sends jam signal
idle, starts frame 5. After aborting, NIC
transmission. If NIC enters binary
senses channel busy, (exponential) backoff:
waits until channel idle, • after mth collision, NIC
then transmits. chooses K at random
3. If NIC transmits entire from {0,1,2, …, 2m-1}.
frame without detecting NIC waits K·512 bit
another transmission, times, returns to Step 2
NIC is done with frame ! • longer backoff interval
with more collisions
CSMA/CD efficiency
▪ Tprop = max prop delay between 2 nodes in LAN
▪ ttrans = time to transmit max-size frame

▪ efficiency goes to 1
• as tprop goes to 0
• as ttrans goes to infinity
▪ better performance than ALOHA: and simple, cheap,
decentralized!
“Taking turns” MAC protocols
channel partitioning MAC protocols:
▪ share channel efficiently and fairly at high load
▪ inefficient at low load: delay in channel access, 1/N
bandwidth allocated even if only 1 active node!
random access MAC protocols
▪ efficient at low load: single node can fully utilize
channel
▪ high load: collision overhead
“taking turns” protocols
look for best of both worlds!
“Taking turns” MAC protocols
polling:
▪ master node “invites”
slave nodes to transmit dat
in turn a pol
l
▪ typically used with
“dumb” slave devices maste
dat r
▪ concerns: a
• polling overhead
• latency
• single point of slave
failure (master) s
“Taking turns” MAC protocols
token passing:
T
▪ control token passed
from one node to next
sequentially.
▪ token message (nothin
▪ concerns: g
▪ token overhead to T
send)
▪ latency
▪ single point of failure
(token)

data
Cable access network
Internet frames, TV channels, control transmitted
downstream at different frequencies

cable headend

CMTS

splitte cable
cable modem … r mode
m
termination system

IS upstream Internet frames, TV control, transmitted


P upstream at different frequencies in time slots

▪ multiple 40Mbps downstream (broadcast) channels


▪ single CMTS transmits into channels
▪ multiple 30 Mbps upstream channels
▪ multiple access: all users contend for certain upstream
channel time slots (others assigned)
Cable access network
cable headend MAP frame for
Interval [t1, t2]
Downstream channel i
CMTS
Upstream channel j

t1 t2 Residences with cable modems

Minislots containing Assigned minislots containing cable modem


minislots request frames upstream data frames

DOCSIS: data over cable service interface spec


▪ FDM over upstream, downstream frequency channels
▪ TDM upstream: some slots assigned, some have contention
• downstream MAP frame: assigns upstream slots
• request for upstream slots (and data) transmitted
random access (binary backoff) in selected slots
Summary of MAC protocols
▪ channel partitioning, by time, frequency or code
• Time Division, Frequency Division
▪ random access (dynamic),
• ALOHA, S-ALOHA, CSMA, CSMA/CD
• carrier sensing: easy in some technologies (wire), hard
in others (wireless)
• CSMA/CD used in Ethernet
• CSMA/CA used in 802.11
▪ taking turns
• polling from central site, token passing
• Bluetooth, FDDI, token ring
MAC addresses and ARP
▪ 32-bit IP address:
• network-layer address for interface
• used for layer 3 (network layer) forwarding
▪ MAC (or LAN or physical or Ethernet) address:
• function: used ‘locally” to get frame from one interface to
another physically-connected interface (same network, in
IP-addressing sense)
• 48 bit MAC address (for most LANs) burned in NIC ROM,
also sometimes software settable
• e.g.: 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation


(each “numeral” represents 4 bits)
LAN addresses and ARP
each adapter on LAN has unique LAN address

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

LAN
(wired or adapte
wireless r
71-65- )
F7-2B-08-53 58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98
LAN addresses (more)
▪ MAC address allocation administered by IEEE
▪ manufacturer buys portion of MAC address
space (to assure uniqueness)
▪ analogy:
• MAC address: like Social Security Number
• IP address: like postal address
▪ MAC flat address ➜ portability
• can move LAN card from one LAN to another
▪ IP hierarchical address not portable
• address depends on IP subnet to which node is
attached
ARP: address resolution protocol
Question: how to determine
interface’s MAC address,
knowing its IP address? ARP table: each IP node (host,
router) on LAN has table
137.196.7.7
• IP/MAC address
8 mappings for some
1A-2F-BB-76-09-
AD LAN nodes:
137.196.7.2
3 137.196.7.1 < IP address; MAC address; TTL>
4 • TTL (Time To Live):
time after which
71-65- LAN address mapping will be
F7-2B-08-53 58-23-D7-FA-20-B0
forgotten (typically 20
min)
0C-C4-11-6F-E3-98
137.196.7.8
8
ARP protocol: same LAN
▪ A wants to send datagram
to B
• B’s MAC address not in A’s ▪ A caches (saves) IP-to-
ARP table. MAC address pair in its
▪ A broadcasts ARP query ARP table until
packet, containing B's IP information becomes old
address (times out)
• destination MAC address = • soft state: information that
FF-FF-FF-FF-FF-FF times out (goes away)
• all nodes on LAN receive unless refreshed
ARP query ▪ ARP is “plug-and-play”:
▪ B receives ARP packet, • nodes create their ARP
replies to A with its (B's) tables without intervention
MAC address from net administrator
• frame sent to A’s MAC
address (unicast)
Addressing: routing to another LAN
walkthrough: send datagram from A to B via R
▪ focus on addressing – at IP (datagram) and MAC layer (frame)
▪ assume A knows B’s IP address
▪ assume A knows IP address of first hop router, R (how?)
▪ assume A knows R’s MAC address (how?)

A B
R
111.111.111.111
222.222.222.22
74-29-9C-E8-
29-BD-D2-
4
FF-55
222.222.222.22 C7-56-2A
1A-23-F9-
0
CD-06-9B
111.111.111.112 111.111.111.110 222.222.222.22
CC-49-DE-D0- E6-E9-00-17- 88-
1
AB-7D BB-4B B2-2F-54-1A-0F
Addressing: routing to another LAN
▪ A creates IP datagram with IP source A, destination B
▪ A creates link-layer frame with R's MAC address as destination
address, frame contains A-to-B IP datagram
MAC src: 74-29-9C-E8-FF-55
MAC dest: E6-E9-00-17-BB-4B
IP src: 111.111.111.111
IP dest:
222.222.222.222
IP
Eth
Ph
y
A B
R
111.111.111.111
222.222.222.22
74-29-9C-E8-
29-BD-D2-
4
FF-55
222.222.222.22 C7-56-2A
1A-23-F9-
0
CD-06-9B
111.111.111.112 111.111.111.110 222.222.222.22
CC-49-DE-D0- E6-E9-00-17- 88-
1
AB-7D BB-4B B2-2F-54-1A-0F
Addressing: routing to another LAN
▪ frame sent from A to R
▪ 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: 111.111.111.111
IP dest:
IP src: 111.111.111.111
IP dest: 222.222.222.222
222.222.222.222
IP IP
Eth Eth
Ph Ph
y y
A B
R
111.111.111.111
222.222.222.22
74-29-9C-E8-
29-BD-D2-
4
FF-55
222.222.222.22 C7-56-2A
1A-23-F9-
0
CD-06-9B
111.111.111.112 111.111.111.110 222.222.222.22
CC-49-DE-D0- E6-E9-00-17- 88-
1
AB-7D BB-4B B2-2F-54-1A-0F
Addressing: routing to another LAN
▪ R forwards datagram with IP source A, destination B
▪ R creates link-layer frame with B's MAC address as destination address,
frame contains A-to-B IP datagram

MAC src: 1A-23-F9-CD-06-9B


MAC dest: 49-BD-D2-C7-56-2A
IP src: 111.111.111.111
IP dest:
222.222.222.222 IP
IP Eth
Eth Ph
Ph y
y
A B
R
111.111.111.111
222.222.222.22
74-29-9C-E8-
29-BD-D2-
4
FF-55
222.222.222.22 C7-56-2A
1A-23-F9-
0
CD-06-9B
111.111.111.112 111.111.111.110 222.222.222.22
CC-49-DE-D0- E6-E9-00-17- 88-
1
AB-7D BB-4B B2-2F-54-1A-0F
Addressing: routing to another LAN
▪ R forwards datagram with IP source A, destination B
▪ R creates link-layer frame with B's MAC address as destination address,
frame contains A-to-B IP datagram

MAC src: 1A-23-F9-CD-06-9B


MAC dest: 49-BD-D2-C7-56-2A
IP src: 111.111.111.111
IP dest:
222.222.222.222 IP
IP Eth
Eth Ph
Ph y
y
A B
R
111.111.111.111
222.222.222.22
74-29-9C-E8-
29-BD-D2-
4
FF-55
222.222.222.22 C7-56-2A
1A-23-F9-
0
CD-06-9B
111.111.111.112 111.111.111.110 222.222.222.22
CC-49-DE-D0- E6-E9-00-17- 88-
1
AB-7D BB-4B B2-2F-54-1A-0F
Addressing: routing to another LAN
▪ R forwards datagram with IP source A, destination B
▪ R creates link-layer frame with B's 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
IP src: 111.111.111.111
IP dest:
222.222.222.222
IP
Eth
Ph
y

A B
R
111.111.111.111
222.222.222.22
74-29-9C-E8-
29-BD-D2-
4
FF-55
222.222.222.22 C7-56-2A
1A-23-F9-
0
CD-06-9B
111.111.111.112 111.111.111.110 222.222.222.22
CC-49-DE-D0- E6-E9-00-17- 88-
1
AB-7D BB-4B B2-2F-54-1A-0F
* Check out the online interactive exercises for more
examples: h ttp://gaia.cs.umass.edu/kurose_ross/interactive/
Ethernet
“dominant” wired LAN technology:
▪ single chip, multiple speeds (e.g., Broadcom BCM5761)
▪ first widely used LAN technology
▪ simpler, cheap
▪ kept up with speed race: 10 Mbps – 10 Gbps

Metcalfe’s Ethernet sketch


Ethernet: physical topology
▪ bus: popular through mid 90s
• all nodes in same collision domain (can collide with each
other)
▪ star: prevails today
• active switch in center
• each “spoke” runs a (separate) Ethernet protocol (nodes
do not collide with each other)

switc
starh
bus: coaxial cable
Ethernet frame structure
sending adapter encapsulates IP datagram (or other
network layer protocol packet) in Ethernet frame
type
dest. source
preamble address address data CRC
(payload)

preamble:
▪ 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011
▪ used to synchronize receiver, sender clock rates
Ethernet frame structure (more)
▪ addresses: 6 byte source, destination MAC addresses
• if adapter receives frame with matching destination
address, or with broadcast address (e.g. ARP packet), it
passes data in frame to network layer protocol
• otherwise, adapter discards frame
▪ type: indicates higher layer protocol (mostly IP but
others possible, e.g., Novell IPX, AppleTalk)
▪ CRC: cyclic redundancy check at receiver
• error detected: frame is dropped

type
dest. source
preamble address address data CRC
(payload)
Ethernet: unreliable, connectionless
▪ connectionless: no handshaking between sending and
receiving NICs
▪ unreliable: receiving NIC doesn't send acks or nacks
to sending NIC
• data in dropped frames recovered only if initial
sender uses higher layer rdt (e.g., TCP),
otherwise dropped data lost
▪ Ethernet’s MAC protocol: unslotted CSMA/CD with
binary backoff
802.3 Ethernet standards: link & physical layers

▪ many different Ethernet standards


• common MAC protocol and frame format
• different speeds: 2 Mbps, 10 Mbps, 100 Mbps, 1Gbps,
10 Gbps, 40 Gbps
• different physical layer media: fiber, cable

MAC protocol
applicatio and frame
n format
transport 100BASE-TX 100BASE-T2 100BASE-FX
network 100BASE-T4 100BASE-SX 100BASE-BX
link
physical
copper (twister fiber physical layer
pair) physical layer
Ethernet switch
▪ link-layer device: takes an active role
• store, forward Ethernet frames
• examine incoming frame’s MAC address,
selectively forward frame to one-or-more
outgoing links when frame is to be forwarded
on segment, uses CSMA/CD to access segment
▪ transparent
• hosts are unaware of presence of switches
▪ plug-and-play, self-learning
• switches do not need to be configured
Switch: multiple simultaneous transmissions
▪ hosts have dedicated, direct A
connection to switch
B
▪ switches buffer packets C’

▪ Ethernet protocol used on 6 1 2


each incoming link, but no
collisions; full duplex 5 4 3
• each link is its own collision
B C
domain

▪ switching: A-to-A’ and B-to-B’
can transmit simultaneously, A
without collisions ’
switch with six interfaces
(1,2,3,4,5,6)
Switch forwarding table

Q: how does switch know A’ A

reachable via interface 4, B’ C’ B


reachable via interface 5?
▪ A: each switch has a switch 6 1 2

table, each entry: 5 4 3


▪ (MAC address of host,
B C
interface to reach host, time ’
stamp)
▪ looks like a routing table! A
Q: how are entries created, ’
switch with six interfaces
maintained in switch table? (1,2,3,4,5,6)
▪ something like a routing
protocol?
Switch: self-learning Source:
A
Dest: A’

A A
▪ switch learns which hosts A’
can be reached through B
C’
which interfaces
• when frame received, 6 1 2
switch “learns”
location of sender: 5 4 3
incoming LAN segment
• records sender/location B C

pair in switch table
A

MAC addr interface TTL
A 1 60 Switch table
(initially empty)
Switch: frame filtering/forwarding
when frame received at switch:

1. record incoming link, MAC address of sending host


2. index switch table using MAC destination address
3. if entry found for destination
then {
if destination on segment from which frame arrived
then drop frame
else forward frame on interface indicated by entry
}
else flood /* forward on all interfaces except arriving
interface */
Self-learning, forwarding: example Source:
A
Dest: A’

A A
▪ frame destination, A’, A’

location unknown: floo C’ B

d
▪ destination A location 6 1 2

known: selectively send A


5
A’ 4 3
on just one link B C

A’
A
A

MAC addr interface TTL
A 1 60 switch table
A’ 4 60 (initially empty)
Interconnecting switches
self-learning switches can be connected together:
S4

S1
S3
A S2
F
D I
B C
G H
E

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!)
Self-learning multi-switch example
Suppose C sends frame to I, I responds to C

S4

S1
S3
A S2
F
D I
B C
G H
E

▪ Q: show switch tables and packet forwarding in S1, S2, S3,


S4
Institutional network
mail server
to external
network
router web server

IP subnet
Switches vs. routers
application
transport
both are store-and-forward: network
datagram
▪ routers: network-layer frame link
devices (examine network- physical link frame
layer headers) physical
▪ switches: link-layer devices
(examine link-layer headers) switch

both have forwarding tables: network datagram


▪ routers: compute tables link frame
using routing algorithms, IP physical
addresses application
▪ switches: learn forwarding transport
table using flooding, learning, network
MAC addresses link
physical
Elements of a wireless network

network
infrastructure
Elements of a wireless network
wireless hosts
❖ laptop, smartphone
❖ run applications
❖ may be stationary (non-
mobile) or mobile
network
▪ wireless does not always
infrastructure
mean mobility
Elements of a wireless network
base station
❖ typically connected to
wired network
❖ relay - responsible for
sending packets
between wired network
network
and wireless host(s) in
infrastructure
its “area”
▪ e.g., cell towers,
802.11 access points
Elements of a wireless network
wireless link
❖ typically used to
connect mobile(s) to
base station
❖ also used as backbone
link
network
infrastructure ❖ multiple access protocol
coordinates link access
❖ various data rates,
transmission distance
Characteristics of selected wireless links

20 802.11n
0
5 802.11a, 802.11a,g point-to-
g
4 point
5-11 802.11b 4G: LTWE WIMAX

4 3G: UMTS/WCDMA-HSPDA, CDMA2000-1xEVDO


Data rate

1
(Mbps)

802.1
5

.38 2.5G: UMTS/WCDMA, CDMA2000


4
.05 2G: IS-95, CDMA, GSM
6
Indoo Outdoo Mid-range Long-
r r outdoor range
10-30m 50-200m 200m – 4 outdoor
Km 5Km – 20 Km
Elements of a wireless network
infrastructure mode
❖ base station connects
mobiles into wired
network
❖ handoff: mobile changes
base station providing
network
connection into wired
infrastructure
network
Elements of a wireless network
ad hoc mode
❖ no base stations
❖ nodes can only
transmit to other
nodes within link
coverage
❖ nodes organize
themselves into a
network: route
among themselves
Wireless network taxonomy
single hop multiple hops
host connects to host may have to
infrastructure base station (WiFi, relay through several
WiMAX, cellular) wireless nodes to
(e.g., APs)
which connects to connect to larger
larger Internet Internet: mesh net

no base station, no
connection to larger
no no base station, no
Internet. May have to
infrastructure connection to larger
relay to reach other
Internet (Bluetooth,
a given wireless node
ad hoc nets)
MANET, VANET
Wireless Link Characteristics (1)
important differences from wired link ….

• decreased signal strength: radio signal attenuates as it


propagates through matter (path loss)
• interference from other sources: standardized
wireless network frequencies (e.g., 2.4 GHz) shared
by other devices (e.g., phone); devices (motors)
interfere as well
• multipath propagation: radio signal reflects off objects
ground, arriving ad destination at slightly different
times

…. make communication across (even a point to point)


wireless link much more “difficult”
Wireless Link Characteristics (2)
▪ SNR: signal-to-noise ratio 10-1

• larger SNR – easier to 10-2


extract signal from noise (a
“good thing”) 10-3

▪ SNR versus BER tradeoffs 10-4

BE
• given physical layer: increase

R
power -> increase SNR- 10-5

>decrease BER
10-6
• given SNR: choose physical
layer that meets BER 10-7
requirement, giving highest 1 2 3 4
thruput 0 0
SNR(dB 0 0
)
• SNR may change with QAM256 (8
mobility: dynamically adapt Mbps)
QAM16 (4
physical layer (modulation Mbps)
technique, rate) BPSK (1
Mbps)
Wireless network characteristics
Multiple wireless senders and receivers create additional
problems (beyond multiple access):

A B C
C

A’s signal C’s signal


B strength strength
A

Hidden terminal problem


space

❖ B, A hear each other Signal attenuation:


❖ B, C hear each other ❖ B, A hear each other
❖ A, C can not hear each other ❖ B, C hear each other
means A, C unaware of their ❖ A, C can not hear each other
interference at B interfering at B
Code Division Multiple Access (CDMA)
▪ unique “code” assigned to each user; i.e., code set
partitioning
• all users share same frequency, but each user has own
“chipping” sequence (i.e., code) to encode data
• allows multiple users to “coexist” and transmit
simultaneously with minimal interference (if codes are
“orthogonal”)
▪ encoded signal = (original data) X (chipping
sequence)
▪ decoding: inner-product of encoded signal and
chipping sequence
CDMA encode/decode
channel output Z i,m
.
Zi,m= d i cm
dat d0 = 1
1 1 1 1 1 1 1 1
d1 = -1
a -1 -1 -1 -1 -1 -1 -1 -1
sender bits 1 1 1 1 1 1 1 1 slot 1 slot 0
cod channe channe
-1 -1 -1 -1 -1 -1 -1 -1
e l l
slot 1 slot 0 output
output

M
Di = Σ Zi,m cm
.
m=
1
M
receive 1 1 1 1 1 1 1 1
d0 = 1
d -1 -1 -1 -1 -1 -1 -1 -1 d1 = -1
input 1 1 1 1 1 1 1 slot 1 slot 0
1
cod channe channe
-1 -1 -1 -1 -1 -1 -1 -1
e l l
receiver slot 1 slot 0
output output
CDMA: two-sender interference
channel sums together
transmissions by sender
1 and 2
Sender 1

Sender 2

using same code as


sender 1, receiver
recovers sender 1’s
original data from
summed channel data!
IEEE 802.11 Wireless LAN
802.11b 802.11a
▪ 2.4-5 GHz unlicensed spectrum ▪ 5-6 GHz range
▪ up to 11 Mbps ▪ up to 54 Mbps
▪ direct sequence spread 802.11g
spectrum (DSSS) in physical layer ▪ 2.4-5 GHz range
• all hosts use same chipping ▪ up to 54 Mbps
code 802.11n: multiple antennae
▪ 2.4-5 GHz range
▪ up to 200 Mbps

❖ all use CSMA/CA for multiple access


❖ all have base-station and ad-hoc network versions
802.11 LAN architecture
❖ wireless host
communicates with base
Internet
station
▪ base station = access point
(AP)

hub, switch
❖ Basic Service Set (BSS)
or router (aka “cell”) in
infrastructure mode
contains:
BSS 1 ▪ wireless hosts
▪ access point (AP): base
station
▪ ad hoc mode: hosts only
BSS 2
802.11: Channels, association
▪ 802.11b: 2.4GHz-2.485GHz spectrum divided into 11
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
AP’s name (SSID) and MAC address
• selects AP to associate with
• may perform authentication [Chapter 8]
• will typically run DHCP to get IP address in AP’s
subnet
802.11: passive/active scanning
BBS 1 BBS 2 BBS 1 BBS 2

1
1 1 2 2 AP
AP AP AP
2 3 2
1 3 2 1 4

H H
1 1
passive scanning: active scanning:
(1) beacon frames sent from APs (1) Probe Request frame broadcast
(2) association Request frame sent: H1 from H1
to selected AP (2) Probe Response frames sent
(3) association Response frame sent from APs
from selected AP to H1 (3) Association Request frame sent:
H1 to selected AP
(4) Association Response frame
sent from selected AP to H1
IEEE 802.11: multiple access
▪ avoid collisions: 2+ nodes transmitting at same time
▪ 802.11: CSMA - sense before transmitting
• don’t collide with ongoing transmission by other node
▪ 802.11: no collision detection!
• difficult to receive (sense collisions) when transmitting due to weak
received signals (fading)
• can’t sense all collisions in any case: hidden terminal, fading
• goal: avoid collisions: CSMA/C(ollision)A(voidance)

A B C
C

A’s C’s
B signal
A signal
strengt strengt
h h

space
IEEE 802.11 MAC Protocol: CSMA/CA
802.11 sender
1 if sense channel idle for DIFS then
transmit entire frame (no CD) sender receiver
2 if sense channel busy then
start random backoff time DIFS

timer counts down while channel idle


transmit when timer expires
data
if no ACK, increase random backoff interval,
repeat 2
802.11 receiver SIFS
- if frame received OK
AC
return ACK after SIFS (ACK needed due to
K
hidden terminal problem)
Avoiding collisions (more)
idea: allow sender to “reserve” 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 they’re 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
A B
A
P
RTS(A) RTS(B)

reservation collision
RTS(A)

CTS(A) CTS(A)

DATA (A)
defer

tim
e ACK(A ACK(A
) )
802.11 frame: addressing

2 2 6 6 6 2 6 0- 4
addres addres addres addres
frame duratio seq 2312
s s s s payload CRC
control n contro
1 2 3 4
l

Address 4: used only


Address 1: MAC in ad hoc mode
address Address 3: MAC address
of wireless host or AP of router interface to
to receive this frame which AP is attached
Address 2: MAC
address
of wireless host or AP
transmitting this frame
802.11 frame: addressing

Internet
H1 R1 router

R1 MAC addr H1 MAC addr


dest. source
address address
802.3 frame

AP MAC addr H1 MAC addr R1 MAC addr


address address address
1 2 3
802.11 frame
802.11 frame: more
frame seq #
duration of reserved
(for RDT)
transmission time (RTS/CTS)

2 2 6 6 6 2 6 0- 4
addres addres addres addres
frame duratio seq 2312
s s s s payload CRC
control n contro
1 2 3 4
l

2 2 4 1 1 1 1 1 1 1 1
More Pow
Protocol To From More
Type Subtype Retry er WEP Rsvd
version AP AP data
frag mgt

frame type
(RTS, CTS, ACK, data)
802.11: mobility within same subnet
▪ H1 remains in same
IP subnet: IP address
can remain same
▪ switch: which AP is
associated with H1?
• self-learning (Ch. 5):
switch will see frame
from H1 and
H BBS 2
“remember” which BBS 1
1
switch port can be
used to reach H1
802.11: advanced capabilities
Rate adaptation 10-1

❖ base station, mobile 10-2

dynamically change 10-3

transmission rate

BE
10-4

R
(physical layer 10-5

modulation technique) as 10-6

mobile moves, SNR 10-7


1 2 3 4
varies 0 SNR(dB
)
0 0 0

1. SNR decreases, BER


increase as node moves
QAM256 (8 away from base station
Mbps) (4
QAM16
Mbps)
BPSK (1
Mbps)
2. When BER becomes too
operating
point high, switch to lower
transmission rate but with
lower BER
802.11: advanced capabilities
power management
❖ node-to-AP: “I am going to sleep until next
beacon frame”
▪ AP knows not to transmit frames to this node
▪ node wakes up before next beacon frame
❖ beacon frame: contains list of mobiles with AP-
to-mobile frames waiting to be sent
▪ node will stay awake if AP-to-mobile frames to be
sent; otherwise sleep again until next beacon frame
802.15: personal area network
❖ less than 10 m diameter
❖ replacement for cables (mouse,
keyboard, headphones) S P
❖ ad hoc: no infrastructure
P
❖ master/slaves: M
radius of
coverag
▪ slaves request permission to send e
(to master) S S P
P
▪ master grants requests
❖ 802.15: evolved from
Bluetooth specification
▪ 2.4-2.5 GHz radio band M Master device
Slave device
▪ up to 721 kbps S
P Parked device
(inactive)
Mobile IP
▪ RFC 3344
▪ has many features we’ve seen:
• home agents, foreign agents, foreign-agent registration,
care-of-addresses, encapsulation (packet-within-a-
packet)
▪ three components to standard:
• indirect routing of datagrams
• agent discovery
• registration with home agent
Mobile IP: indirect routing
foreign-agent-to-mobile packet
packet sent by home agent to foreign dest: 128.119.40.186
agent: a packet within a packet

dest: 79.129.13.2 dest: 128.119.40.186

Permanent address:
128.119.40.186

Care-of address:
79.129.13.2
dest: 128.119.40.186
packet sent by
correspondent
Mobile IP: agent discovery
❖ agent advertisement: foreign/home agents advertise
service by broadcasting ICMP messages (typefield = 9)

H,F bits: home and/or


foreign agent

R bit: registration
required
Mobile IP: registration example
visited network:
home agent foreign agent79.129.13/24
HA: COA:
128.119.40.7 79.129.13.2 mobile agent
MA:
ICMP agent adv. 128.119.40.186
COA:
79.129.13.2
….
registration req.
registration req.
COA: 79.129.13.2
COA: 79.129.13.2 HA: 128.119.40.7
HA: 128.119.40.7 MA: 128.119.40.186
MA: 128.119.40.186 Lifetime: 9999
Lifetime: 9999 identification:714
identification: 714 ….
encapsulation format
….

registration reply
HA: 128.119.40.7 registration reply
MA: 128.119.40.186 HA: 128.119.40.7
Lifetime: 4999 MA: 128.119.40.186
Identification: 714 Lifetime: 4999
encapsulation format Identification: 714
…. ….
time
Components of cellular network architecture

recall: corresponden
wired public t
telephone
network

MSC MSC

MSC
MSC
MSC

different cellular networks,


operated by different providers
Handling mobility in cellular networks

❖ home network: network of cellular provider you


subscribe to (e.g., Sprint PCS, Verizon)
▪ home location register (HLR): database in home
network containing permanent cell phone #, profile
information (services, preferences, billing), information
about current location (could be in another network)
❖ visited network: network in which mobile
currently resides
▪ visitor location register (VLR): database with entry for
each user currently in network
▪ could be home network
GSM: indirect routing to mobile
home
HL
networ corresponden
R 2 k t
home
Mobile
home MSC consults Switching
HLR, Center
gets roaming number of
mobile in visited network call routed
1
to home
3 Public
VL switched network
Mobile
R Switching telephone
network
Center
4
home MSC sets up 2 nd leg of call
to MSC in visited network
mobil
e MSC in visited network completes
user
visited call through base station to
networ mobile
k
GSM: handoff with common MSC
❖ handoff goal: route call via
new base station (without
interruption)
VL Mobile ❖ reasons for handoff:
R Switching ▪ stronger signal to/from new BSS
(continuing connectivity, less
Center battery drain)
old new ▪ load balance: free up channel in
routin routin current BSS
old g g ▪ GSM doesnt mandate why to
BSS new perform handoff (policy), only
BSS
how (mechanism)
❖ handoff initiated by old BSS
GSM: handoff with common MSC
1. old BSS informs MSC of impending
handoff, provides list of 1+ new BSSs
2. MSC sets up path (allocates resources)
to new BSS
VL Mobile 3. new BSS allocates radio channel for
R Switching
use by mobile
2
4
Center 4. new BSS signals MSC, old BSS: ready
1
7
8 5. old BSS tells mobile: perform handoff
3
to new BSS
old 5 6
BSS new 6. mobile, new BSS signal to activate new
BSS
channel
7. mobile signals via new BSS to MSC:
handoff complete. MSC reroutes call
8 MSC-old-BSS resources released
GSM: handoff between MSCs
❖ anchor MSC: first MSC
visited during call
home network
corresponden ▪ call remains routed
Home t through anchor MSC
MSC
❖ new MSCs add on to end of
anchor MSC MSC chain as mobile moves
MSC
PSTN
to new MSC
MSC
❖ optional path minimization
MSC
step to shorten multi-MSC
chain

(a) before
handoff
GSM: handoff between MSCs
❖ anchor MSC: first MSC
visited during call
home network

Home
corresponden ▪ call remains routed
t
MSC through anchor MSC
anchor MSC
❖ new MSCs add on to end of
MSC
PSTN
MSC chain as mobile moves
MSC
to new MSC
MSC
❖ optional path minimization
step to shorten multi-MSC
chain
(b) after
handoff
Mobility: GSM versus Mobile IP
GSM element Comment on GSM element Mobile IP element
Home system Network to which mobile user’s permanent Home
phone number belongs network
Gateway Mobile Home MSC: point of contact to obtain Home agent
Switching Center, or routable address of mobile user. HLR:
“home MSC”. Home database in home system containing
Location Register permanent phone number, profile information,
(HLR) current location of mobile user, subscription
information
Visited System Network other than home system where Visited
mobile user is currently residing network
Visited Mobile Visited MSC: responsible for setting up calls Foreign agent
services Switching to/from mobile nodes in cells associated with
Center. MSC. VLR: temporary database entry in
Visitor Location visited system, containing subscription
Record (VLR) information for each visiting mobile user
Mobile Station Routable address for telephone call segment Care-of-
Roaming Number between home MSC and visited MSC, visible address
(MSRN), or to neither the mobile nor the correspondent.
“roaming number”

You might also like