* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Chapter 6 Lecture Slides
Survey
Document related concepts
Network tap wikipedia , lookup
Computer network wikipedia , lookup
Airborne Networking wikipedia , lookup
Policies promoting wireless broadband in the United States wikipedia , lookup
Code-division multiple access wikipedia , lookup
Wireless security wikipedia , lookup
Transcript
ECE/CS 372 – introduction to computer networks
Lecture 14
Announcements:
Assign 4 is due this Thursday
Lab 4 is due next Tuesday
Assignment 5 posted soon…
Credit for lecture slides to Professor Bechir Hamdaoui
Adapted from Jim Kurose & Keith Ross (original copyright)
Chapter 6, slide
1
Wireless and Mobile Networks
Background:
success of wireless: # wireless (mobile) phone
subscribers now exceeds # wired phone subscribers!
Internet: anytime & anywhere: laptops, PDAs,
tablets, iPhones, MagicJack, IP-enabled devices
two important (but different) challenges
wireless: communication over wireless link
mobility: handling the mobile user who changes point of
attachment to network
Chapter 6, slide
2
Elements of a wireless network
wireless hosts
e.g.: laptop, iPhone
run: applications
stationary or mobile
network
infrastructure
wireless does not
always mean mobility
Chapter 6, slide
3
Elements of a wireless network
network
infrastructure
base station
bridge: typically
connected to wired
network
relay: responsible for
sending pkts between
backbone network
and wireless host(s)
e.g., cell towers,
802.11 access
points
Chapter 6, slide
4
Elements of a wireless network
network
infrastructure
wireless link
connects: mobiles to
base station
multiple access
protocol: coordinates
link access
various data rates,
transmission distance
Chapter 6, slide
5
Elements of a wireless network
network
infrastructure
infrastructure mode
bridge: base station
connects mobiles into
wired network
handoff: mobile
changes base station
providing connection
into wired network
Chapter 6, slide
6
Elements of a wireless network
ad hoc mode
no base stations
limited range: nodes
can only transmit to
other nodes within
link coverage
multi-hop: nodes
organize themselves
into a network: route
among themselves
Chapter 6, slide
7
Wireless network taxonomy
Infrastructure
Single
Hop
1. hosts connect
to base station
2. base station
connects to
larger Internet
E.g.: WiFi/Cellular
1. hosts may have to
Multiple
relay via multiple
hops
nodes (multi-hop)
2. connects to larger
Internet
E.g.: mesh network
Infrastructure-less
1. no base station
2. no connection to
larger Internet
E.g.: Bluetooth
1. no base station
2. no connection to
larger Internet
3. may have to relay
via others to reach
a given node
E.g.: MANET
large
large
InternetInternet
Mobile Ad-Hoc
WiFi Network
Bluetooth
Network
Network
(MANET)
Mesh Network
Chapter 6, slide
8
Outline
Wireless
wireless characteristics
multiple access schemes
TDMA/FDMA
CDMA
Mobility
principles:
addressing
routing to mobile users
mobile IP
Wi-Fi wireless LANs
CSMA/CA
IEEE 802.11
Chapter 6, slide
9
Wireless Link Characteristics
Differences from wired link ….
decayed 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)
multipath
propagation: radio signal reflects off
objects ground, arriving at destination at slightly
different times
…. make communication across (even a point to point)
wireless link much more “difficult”
Chapter 6, slide
10
Wireless Network Characteristics
Multiple wireless senders and receivers create
additional problems (beyond multiple access):
C
A
B
A
B
Hidden terminal problem
C
C’s signal
strength
A’s signal
strength
space
B, A hear each other
Signal attenuation:
A, C can not hear each other,
B, C hear each other
B, C hear each other
meaning that A, C are unaware
of their interference at B
B, A hear each other
A, C can not hear each other
can interfere at B
Chapter 6, slide
11
Outline
Wireless
wireless characteristics
multiple access schemes
TDMA/FDMA
CDMA
Mobility
principles:
addressing
routing to mobile users
mobile IP
Wi-Fi wireless LANs
CSMA/CA
IEEE 802.11
Chapter 6, slide 12
Multiple Access Schemes
Q: How can multiple users share the medium?
FDMA: Frequency Division Multiple Access
(seen before)
TDMA: Time Division Multiple Access
(seen before)
CDMA: Code Division Multiple Access
(will be discussed next)
CSMA/CA: Carrier-Sense Multiple Access (i.e., Wi-Fi)
(will be discussed later)
Chapter 6, slide
13
FDMA and TDMA (review)
Example:
FDMA
4 users
frequency
time
TDMA
frequency
time
Chapter 6, slide
14
CDMA
all users use all frequency (like TDMA)
all users send at all time (like FDMA)
allows multiple users to “coexist” and transmit
simultaneously
a unique “code” assigned to each user
encoding at sender: (original data) x (code)
decoding at receiver: (encoded signal) x (code)
Chapter 6, slide
15
CDMA Encode/Decode: one sender only
We use “-1” to mean “0”
Each user is assigned a unique code:
cm = [-1 -1 -1 1 -1 1 1 1]
(length of cm is M = 8 in this example)
Channel output
Zi,m= di.cm
Z1,m= d1.cm
d0 = 1
sender
Sent bits: di
Code: cm
1 1 1
-1 -1 -1
1
-1
1 1 1
-1 -1 -1
2nd bit
-1 -1 -1
1st bit
Z1,m= d1.cm
Received bits
receiver
Code: cm
-1 -1 -1
-1
1 1 1
1
-1
1 1 1
-1 -1 -1
1
-1
-1 -1 -1
1st bit
channel
output
Decoding at receiver:
di = (Zi,m.cm)/8 = (di.cm.cm)/8 = di
1
-1 -1 -1
-1
2nd bit
Note that cm .cm = 8
Z0,m= d0.cm
1 1 1 1 1 1
1
-1
2nd bit
channel
output
1
-1
1 1 1 1 1 1
1
d1 = -1
Z0,m= d0.cm
1
-1
-1 -1 -1
d0 = 1
d1 = -1
decoded
2nd bit
decoded
1st bit
1st bit
Chapter 6, slide
16
CDMA: two-senders and interference
Chapter 6, slide
17
CDMA: two-senders and interference
M = length of cm
Chapter 6, slide
18
CDMA: Example of multiple users
See board notes for a CDMA example.
Chapter 6, slide
19
ECE/CS 372 – introduction to computer networks
Lecture 15
Announcements:
• Assignment 4 due now
• Lab 4 due next Tuesday
• Assignment 5 posted, due next
Thursday
Credit for lecture slides to Professor Bechir Hamdaoui
Adapted from Jim Kurose & Keith Ross (original copyright)
Chapter 6, slide 20
Outline
Wireless
wireless characteristics
multiple access schemes
TDMA/FDMA
CDMA
Mobility
principles:
addressing
routing to mobile users
mobile IP
Wi-Fi wireless LANs
CSMA/CA
IEEE 802.11
Chapter 6, slide 21
IEEE 802.11: multiple access
There are two access operating modes
Infrastructure
based mode
Ad hoc
based mode
Chapter 6, slide
22
IEEE 802.11: multiple access
There are two multiple access functions:
Point Coordination
Function (PCF)
TDMA-like access
Point Coordinator (PC)
polls users in a roundrobin fashion
No contention
Synchronous
Infrastructure mode
Distributed Coordination
function (DCF)
CSMA-like access
Random access: listenbefore-talk
Contention-like medium
Asynchronous
Both infrastructure and
adhoc modes
Chapter 6, slide
23
IEEE 802.11 multiple access
Contention and contention free periods:
CFP
CP
CFP
CP
Contention-Free Period (CFP)
Contention Period (CP)
Synchronous traffic
Asynchronous traffic
Point Coord. Fct (PCF) is the
Distr. Coord. Fct (DCF)
access method
is the access method
Access point alternates between CFP and CP modes
Chapter 6, slide
24
IEEE 802.11 DCF MAC
one at a time: 2+ nodes send at same time => collision
CSMA - sense before transmitting
don’t collide with ongoing transmission by other node
no collision detection
difficult to sense collision when transmitting due to weak sigl
goal: avoid collisions: CSMA/C(ollision)A(voidance)
use Acknowledgment mechanism to recover from collision
C
A
B
A
B
C
C’s signal
strength
A’s signal
strength
space
Two scenarios where collision cannot be detected
Chapter 6, slide
25
IEEE 802.11 DCF MAC
Simple MAC
if channel idle for SIFS=10 µsec then
sender transmits frame
receiver waits for SIFS=10 µsec
and sends ACK
sender
receiver
SIFS
(SIFS stands for Short InterFrame Space, and
allows HW to switch from rx to tx)
data
Challenges/issues
(1) more than one communication
higher collision rate (100%)
(2) when collision occurs, it at least should not
occur when ACK is being sent
allow ACK to be sent successfully
SIFS
ACK
Chapter 6, slide
26
IEEE 802.11 DCF MAC
Simple MAC w/ minor improvement
if channel idle for DIFS=50 µsec then
sender
sender transmits frame
DIFS
receiver waits for SIFS=10 µsec
only and sends ACK
SIFS < DIFS ACK gains access before
receiver
data
(DIFS stands for DCF InterFrame Space)
Challenges/issues
(1) sure, it now prevents collision between
DATA & ACK
SIFS
ACK
(2) but collision can still occur between DATAs
How to reduce collision even further?
Chapter 6, slide
27
IEEE 802.11 DCF MAC
MAC w/ backoff
After medium sensed ‘busy’
don’t send right away
wait for a random time, then transmit
idea:
different senders will hopefully pick
different times to transmit so as to avoid colliding
with each other again
Chapter 6, slide
28
IEEE 802.11 DCF MAC
MAC w/ backoff
After medium sensed ‘busy’
DIFS
DIFS
Medium busy
Data ready
Defer access
W = contention window
Random counter
Backoff counter b
Transmit!
contention window W: define new parameter W = 8, 16, 32, etc
backoff counter b: pick a random number b from [0,W]
E.g., if W = 64, perhaps b = 23
Decrement counter b by 1 every idle slot
If someone else goes first, reset ‘b’ but don’t change ‘W’
If counter reaches 0, transmit
Chapter 6, slide
29
IEEE 802.11 DCF MAC
MAC w/ backoff
After collision
DIFS
DIFS
Medium busy
Collision?
Defer access
W = contention window
Random counter
Backoff counter b
Transmit!
contention window W: define new parameter W = 8, 16, 32, etc
backoff counter b: pick a random number b from [0,W]
E.g., if W = 64, perhaps b = 23
Decrement counter b by 1 every idle slot
If counter reaches 0, transmit
If another collision, reset ‘b’ & increase ‘W’
Chapter 6, slide
30
IEEE 802.11 DCF MAC
MAC w/ backoff
After collision
DIFS
DIFS
Medium busy
Collision?
Defer access
W = contention window
Random counter
Backoff counter b
Transmit!
Challenge
How to choose W?
lower W higher collision waste of bandwidth
higher W lower collision but wasted, unused slots
Solution: W should adapt/adjust to loads/# of users
W increases as # of users increases and vice-versa
Exponential Backoff
Chapter 6, slide
31
IEEE 802.11 DCF MAC
MAC w/ exponentional backoff
exponential backoff:
(1)
(2)
increase W when collision
decrease W when success
This is how it works:
set W = W0 (this is an initial value)
pick random backoff counter b from [0,W]
transmit when counter reaches 0
if collision occurs, set W 2W (double window)
and repeat
Chapter 6, slide
32
IEEE 802.11 DCF MAC
MAC w/ exponentional backoff
Example
Initial window W0 = 8
1st collision: set W1=W0=8; pick b from [0,1,…,7= W1-1]
2nd collision: set W2=2W0=16; pick b from [0,1,…,15= W2-1]
mth collision: set Wm=2(m-1)W0; pick b from [0,1,…, Wm-1]
Maximum window size = Wmax = 2(m-1)W0
After mth collision, Window is set to Wmax
For example: (m+1)th collision, Wm+1= Wmax
at ith collision: Wi = min {2(i-1)W0, Wmax}
Chapter 6, slide
33
IEEE 802.11 DCF MAC
MAC w/ exponentional backoff
How do you detect a collision without collision detection?
You don’t!
You intuit them!
Any failed transmission (i.e. you didn’t get an ACK) is
interpreted as a collision.
Chapter 6, slide
34
More challenges: Hidden terminal problem
C
A
B
A
B
Hidden terminal problem
C
C’s signal
strength
A’s signal
strength
space
B, A hear each other
Signal attenuation:
A, C can not hear each other,
B, C hear each other
B, C hear each other
and hence, may interfere at B
B, A hear each other
A, C can not hear each
Problem:
If A is transmitting to B, C won’t be able to sense that medium is busy
Chapter 6, slide
35
RTS/CTS handshaking mechanism
idea: allow sender to “reserve” channel rather than
random access of data frames
Solves the hidden terminal problem
Avoids collisions of long data frames
Sender: transmits small request-to-send (RTS) packets
Receiving neighbors all hear this RTS defer receipt
RTSs may still collide with each other (but they’re short)
Receiver: transmits small clear-to-send (CTS) packets
in response to RTS
Sending neighbors all hear CTS defer transmission
Chapter 6, slide
36
Collision Avoidance: RTS-CTS exchange
A
B
C
reservation collision
DATA (A)
defer
time
Chapter 6, slide
37
Final words
Carrier sense mechanisms: there are two types
Physical carrier sensing
actual sensing of medium to determine whether it is
busy or not
Virtual carrier sensing
provided by MAC via RTS/CTS frames. Predicts
future traffic based on information/duration
indicated in RTS/CTS frames
Chapter 6, slide
38
Outline
Wireless
wireless characteristics
multiple access schemes
TDMA/FDMA
CDMA
Mobility
principles:
addressing
routing to mobile users
mobile IP
Wi-Fi wireless LANs
CSMA/CA
IEEE 802.11
Chapter 6, slide 39
What is mobility?
spectrum of mobility, from the network perspective:
no mobility
mobile wireless user, mobile user,
using same access
connecting/
point
disconnecting
from network
using DHCP.
high mobility
mobile user, passing
through multiple
access point while
maintaining ongoing
connections (like cell
phone)
Chapter 6, slide
40
Mobility: Vocabulary
home network: permanent
“home” of mobile
(e.g., 128.119.40/24)
Permanent address:
address in home
network, can always be
used to reach mobile
e.g., 128.119.40.186
home agent: entity that will
perform mobility functions on
behalf of mobile, when mobile
is remote
wide area
network
correspondent
Chapter 6, slide
41
Mobility: more vocabulary
Permanent address: remains
constant (e.g., 128.119.40.186)
visited network: network
in which mobile currently
resides (e.g., 79.129.13/24)
Care-of-address: address
in visited network.
(e.g., 79,129.13.2)
wide area
network
correspondent: wants
to communicate with
mobile
foreign agent: entity
in visited network
that performs
mobility functions on
behalf of mobile.
Chapter 6, slide
42
How do you contact a mobile friend:
Consider a friend who frequently
changes addresses, how do you
find her?
I wonder where
Alice moved to?
expect her to update
the new phone book:
So, search all phone
books for new address?
expect her to let you
know where she is?
So, use her new address
expect her to let her
parents know
So, call her parents?
Chapter 6, slide
43
Mobility: approaches
Let routing handle it: routers advertise permanent
address of mobile-nodes-in-residence via usual
routing table exchange.
routing tables indicate where each mobile located
no changes to end-systems
Let end-systems handle it:
Let
mobile inform his home agent
E.g. let Alice inform her parents
Alice’s friend must contact her parent before
Chapter 6, slide
44
Mobility: approaches
Let routing handle it: routers advertise permanent
not
address of mobile-nodes-in-residence
via usual
scalable
routing table exchange.
to millions of
routing tables indicate
mobiles where each mobile located
no changes to end-systems
Let end-systems handle it:
Let
mobile inform his home agent
E.g. let Alice inform her parents
Alice’s friend must contact her parent before
Chapter 6, slide
45
Mobility: registration
visited network
home network
2
1
wide area
network
foreign agent contacts home
agent home: “this mobile is
resident in my network”
mobile contacts
foreign agent on
entering visited
network
End result:
Foreign agent knows about mobile
Home agent knows location of mobile
Chapter 6, slide
46
Mobility via Indirect Routing
indirect routing: communication from correspondent to mobile goes
via home agent, then forwarded to remote
foreign agent
receives packets,
forwards to mobile
home agent intercepts
packets, forwards to
foreign agent
home
network
visited
network
3
wide area
network
correspondent
addresses packets
using home address
of mobile
1
2
4
mobile replies
directly to
correspondent
Chapter 6, slide
47
Mobility via Direct Routing
direct routing: correspondent gets foreign address of mobile, then
sends directly to mobile
correspondent forwards
to foreign agent
foreign agent
receives packets,
forwards to mobile
home
network
4
wide area
network
2
correspondent
requests, receives
foreign address of
mobile
visited
network
1
3
5
mobile replies
directly to
correspondent
Chapter 6, slide
48
Outline
Wireless
wireless characteristics
multiple access schemes
TDMA/FDMA
CDMA
Mobility
principles:
addressing
routing to mobile users
mobile IP
Wi-Fi wireless LANs
CSMA/CA
IEEE 802.11
Chapter 6, slide 49
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)
Uses indirect routing of datagrams
Chapter 6, slide
50
Mobile IP: indirect routing
foreign-agent-to-mobile packet
packet sent by home agent to foreign
agent: a packet within a packet
dest: 79.129.13.2
dest: 128.119.40.186
dest: 128.119.40.186
Permanent address:
128.119.40.186
dest: 128.119.40.186
Care-of address:
79.129.13.2
packet sent by
correspondent
Chapter 6, slide
51
Wireless, mobility: last words…
Challenges/issues…
packet loss/delay due to bit-errors (discarded
packets, delays for link-layer retransmissions),
and handoff
congestion: TCP interprets loss as congestion,
will decrease congestion window unnecessarily
bandwidth: limited bandwidth of wireless links
Chapter 6, slide
52