Mobile Computing - University of Notre Damecpoellab/teaching/cse40814_fall14/Lecture4-Nets.pdf9/8/14...
Transcript of Mobile Computing - University of Notre Damecpoellab/teaching/cse40814_fall14/Lecture4-Nets.pdf9/8/14...
9/8/14
1
Mobile Computing CSE 40814/60814
Fall 2014
What is a Network? • A network is a "group of computers and
associated devices that are connected by communications facilities.” – A network supports communication among users in ways that other
media cannot. E-mail, the most popular form of network communication, provides low-cost, printable correspondence with the capability for forwarding, acknowledgment, storage, retrieval, and attachments.
– Sharing involves not only information (database records, e-mail, graphics, etc.), but also resources (applications, printers, modems, disk space, scanners, etc.). Through its ability to share, a network promotes collaboration.
1
Types of Networks • Scope – Local area network (LAN) – Metropolitan area (MAN) – Wide area network (WAN)
• Ownership – Closed versus open
• Topology (configuration) – Bus (Ethernet) – Star (wireless networks with central access point) – Ring – Mesh
2
9/8/14
2
Network Topologies • A topology refers to the manner in which the
cable is run to individual workstations on the network. – Star, bus, ring, mesh
3
LAN Technology: Ethernet • Ethernet is a popular, relatively inexpensive, easy-to-install LAN
architecture with the following characteristics: – Uses the CSMA/CD media access control. – Data transmission normally occurs at 100 Mbps (10Mbps in the early forms
and 10Gbps in the most recent forms). • The Ethernet architecture conforms to most but not all of the IEEE 802.3
specification (the physical layers are identical but the MAC layers are somewhat different).
• An Ethernet LAN is often described in terms of three parameters: transmission rate, transmission type, and segment distance or cable type. – "100baseT" means:
• 100 - transmission rate or throughput of 100Mbps • base - transmission type is baseband rather than broadband network (i.e., the signal
is placed directly on the cable, one signal at a time) • T – the cable type (e.g., twisted pair)
• Few types of Ethernet: 10Base2, 10Base5, 10BaseT and 10BaseF, 100BaseT, 100BaseF, etc.
4
ISO/OSI Model • The International Standards Organization (ISO) Open Systems Interconnect
(OSI) is a standard set of rules describing the transfer of data between each layer in a network operating system. Each layer has a specific function (i.e., the physical layer deals with the electrical and cable specifications).
5
9/8/14
3
ISO/OSI Model • Physical Layer
– Physical characteristics of network (cable type/length, connectors, etc.). – Electrical characteristics of signals (voltage levels/durations, etc.). – Transmits binary data (bits) as electrical or optical signals.
• Data Link Layer – Defines when/how medium will be accessed for transmission. – Works with “frames”. – Performs error detection and correction. – Often divided into sublayers (lower: network access; upper: sending/receiving
packets, error checking). – “MAC” addresses.
• Network Layer – Addressing and routing (“IP” addresses). – IP protocol.
6
ISO/OSI Model • Transport Layer
– UDP (User Datagram Protocol). – TCP (Transmission Control Protocol). – Addressing (“ports”), error correcJon, flow control, congesJon
control.
• Session Layer – Management of “sessions”.
• PresentaJon Layer – Data translaJon, formaOng, encrypJon, compression.
• ApplicaJon Layer – Interface between user applicaJons and lower network services.
7
ISO/OSI Model
9/8/14
4
ISO/OSI Model
OSI vs. TCP/IP
Medium Access Control (MAC) • Responsible for deciding when & how to transmit frames over a network (“channel access problem”).
• Design and realizaJon of MAC protocol is very important for “quality” of communicaJons (successful transmissions, reliable transmissions, high throughput, low latency, fairness, …).
11
A C B
9/8/14
5
Simultaneous Transmissions
• Ignore ongoing communicaJons and just transmit: – Large number of “collisions”. – Low throughput.
12
A C B
collision
“Smarter” Approach
• Listen before you talk! • Carrier Sense MulJple Access (CSMA). – “Sense” (listen) carrier. – If “busy” wait; if “idle” transmit.
13
A C B
Don’t transmit
Can collisions sJll occur?
Collisions in CSMA • Collisions sJll do occur: – Non-‐zero propagaJon delays.
– ParJal collision: enJre packet lost.
14
9/8/14
6
CSMA/CD • CD = Collision DetecJon. • How? Keep listening to channel!
• If transmiged signal and sensed signal differ: – Collision detected. – Abort transmission. – (Jam channel).
15
CSMA/CD • AssumpJon: the received and transmiged signal are idenJcal (non-‐dispersive).
• AssumpJon: receiver “sees” the same signals as transmigers on channel.
• Problem: both not true in wireless networks! • Transmiger does not know what the receiver “sees” and therefore does not know if transmission was successful.
16
Wireless Transmissions
17
A B C D
Distance
Signal power
9/8/14
7
Collision Detection
• Signal received depends on “signal to interference plus noise raJo” (SINR = P/(I+N)).
18
A C D B
Hidden Terminal/Exposed Terminal
• Hidden terminal: C does not hear A (and A cannot hear C), but it can interfere with A at B. – Node SHOULD NOT transmit!
• Exposed terminal: X hears A and wants to transmit to Y. It cannot interfere with A at B. – Node SHOULD transmit!
19
A B C D X
X is the exposed terminal to A Y
C is the hidden terminal to A
IEEE 802.11 (CSMA/CA)
20
CTS = Clear To Send
RTS = Request To Send
D
Y
S
M
K
RTS
CTS
X
9/8/14
8
21
D
Y
S
X
M
K silenced
silenced
silenced
silenced Data
ACK
IEEE 802.11
IEEE 802.11 • All backlogged nodes choose a random number
– R = rand (0, CW_min)
• Each node counts down R – ConJnue carrier sensing while counJng down – Once carrier busy, freeze countdown
• Whoever reaches ZERO transmits RTS – Neighbors freeze countdown, decode RTS – RTS contains (CTS + DATA + ACK) duraJon = T_comm – Neighbors set NAV = T_comm
• Remains silent for NAV Jme
22
IEEE 802.11 • Receiver replies with CTS
– Also contains (DATA + ACK) duraJon. – Neighbors update NAV again
• Tx sends DATA, Rx acknowledges with ACK – Ater ACK, everyone iniJates remaining countdown – Tx chooses new R = rand (0, CW_min)
• If RTS or DATA collides (i.e., no CTS/ACK returns) – Indicates collision – RTS chooses new random no. R1 = rand (0, 2*CW_min) – Note ExponenJal Backoff Ri = rand (0, 2^i * CW_min) – Once successful transmission, reset to rand(0, CW_min)
23
9/8/14
9
Recap • CSMA/CD: works good in wired networks; but doesn’t work in wireless networks.
• CMSA/CA (“collision avoidance”): goal is to reduce the occurrences of collisions instead of detecJng and handling them.
24
Frequencies for Communication • VLF = Very Low Frequency UHF = Ultra High Frequency • LF = Low Frequency SHF = Super High Frequency • MF = Medium Frequency EHF = Extra High Frequency • HF = High Frequency UV = Ultraviolet Light • VHF = Very High Frequency
• Frequency and wave length – λ = c/f – wave length λ, speed of light c ≅ 3x108m/s, frequency f
1 Mm 300 Hz
10 km 30 kHz
100 m 3 MHz
1 m 300 MHz
10 mm 30 GHz
100 µm 3 THz
1 µm 300 THz
visible light VLF LF MF HF VHF UHF SHF EHF infrared UV
opJcal transmission coax cable twisted pair
Frequencies for Mobile Communication • VHF-‐/UHF-‐ranges for mobile radio
– simple, small antenna for cars – determinisJc propagaJon characterisJcs, reliable connecJons
• SHF and higher for directed radio links, satellite communicaJon – small antenna, beam forming – large bandwidth available
• Wireless LANs use frequencies in UHF to SHF range – some systems planned up to EHF – limitaJons due to absorpJon by water and oxygen molecules (resonance
frequencies) • weather dependent fading, signal loss caused by heavy rainfall, etc.
9/8/14
10
Frequencies and Regulations • ITU-‐R holds aucJons for new frequencies, manages frequency bands
worldwide (WRC, World Radio Conferences)
Examples Europe USA Japan
Cellular phones GSM 880-915, 925-960, 1710-1785, 1805-1880 UMTS 1920-1980, 2110-2170
AMPS, TDMA, CDMA, GSM 824-849, 869-894 TDMA, CDMA, GSM, UMTS 1850-1910, 1930-1990
PDC, FOMA 810-888, 893-958 PDC 1429-1453, 1477-1501 FOMA 1920-1980, 2110-2170
Cordless phones
CT1+ 885-887, 930-932 CT2 864-868 DECT 1880-1900
PACS 1850-1910, 1930-1990 PACS-UB 1910-1930
PHS 1895-1918 JCT 245-380
Wireless LANs 802.11b/g 2412-2472
802.11b/g 2412-2462
802.11b 2412-2484 802.11g 2412-2472
Other RF systems
27, 128, 418, 433, 868
315, 915 426, 868
Signal propagation ranges • Transmission range
– communicaJon possible – low error rate
• DetecJon range – detecJon of the signal possible
– no communicaJon possible
• Interference range – signal may not be detected
– signal adds to the background noise
distance
sender
transmission
detecJon
interference
Signal propagation
• PropagaJon in free space always like light (straight line) • Receiving power proporJonal to 1/d² in vacuum – much more in real
environments (d = distance between sender and receiver)
• Path loss (agenuaJon) • Fundamental propagaJon behaviors:
– ground wave (<2MHz): follow earth’s surface, long distances (submarine communicaJon, AM radio)
– sky wave (2-‐30MHz): reflected at ionosphere, around the world (intl. broadcasts, amateur radio)
– line-‐of-‐sight (>30MHz): LOS, straight line, waves are bent by atmosphere due to refracJon (mobile phones, satellite, cordless)
• Most systems we will discuss work with >100MHz: LOS (quesJon: so how do mobile phones work then???)
9/8/14
11
Other propagation effects • Receiving power addiJonally influenced by
– fading (frequency dependent) – shadowing – reflecJon at large obstacles – refracJon depending on the density of a medium – scagering at small obstacles – diffracJon at edges
reflecJon scagering diffracJon shadowing refracJon
Real world example
Multipath propagation • Signal can take many different paths between sender and
receiver due to reflecJon, scagering, diffracJon
• Time dispersion: signal is dispersed over Jme – interference with “neighbor” symbols, Inter Symbol Interference (ISI)
• The signal reaches a receiver directly and phase shited – distorted signal depending on the phases of the different parts
signal at sender signal at receiver
LOS pulses mulJpath pulses
Delay Spread
9/8/14
12
Effects of mobility • Channel characterisJcs change over Jme and locaJon – signal paths change – different delay variaJons of different signal parts – different phases of signal parts – è quick changes in the power received (short term fading)
• AddiJonal changes in – distance to sender – obstacles further away – è slow changes in the average power received (long term fading)
short term fading
long term fading
t
power
• MulJplexing in 4 dimensions – space (si) – Jme (t) – frequency (f) – code (c)
• Goal: mulJple use of a shared medium
• Important: guard spaces needed!
s2
s3
s1
Multiplexing
f
t
c
k2 k3 k4 k5 k6 k1
f
t
c
f
t
c
channels ki
SDM
Frequency division multiplexing (FDM) • SeparaJon of the whole spectrum into smaller frequency
bands • A channel gets a certain band of the spectrum for the
whole Jme • Advantages
– no dynamic coordinaJon necessary
– works also for analog signals
• Disadvantages – waste of bandwidth if the traffic is distributed unevenly
– inflexible
k2 k3 k4 k5 k6 k1
f
t
c
9/8/14
13
f
t
c
k2 k3 k4 k5 k6 k1
Time division multiplexing (TDM) • A channel gets the whole spectrum for a certain amount of
Jme
• Advantages – only one carrier in the medium at any Jme
– throughput high even for many users
• Disadvantages – precise synchronizaJon necessary
f
Time and frequency multiplex • CombinaJon of both methods • A channel gets a certain frequency band for a certain amount of Jme
• Example: GSM • Advantages – beger protecJon against tapping
– protecJon against frequency selecJve interference
• but: precise coordinaJon required
t
c
k2 k3 k4 k5 k6 k1
Code division multiplexing (CDM) • Each channel has unique code • All channels use the same spectrum
at the same Jme • Advantages
– bandwidth efficient – no coordinaJon and synchronizaJon necessary
– good protecJon against interference and tapping
• Disadvantages – varying user data rates – more complex signal regeneraJon
• Implemented using spread spectrum technology
k2 k3 k4 k5 k6 k1
f
t
c
9/8/14
14
Modulation • Digital modulaJon
– digital data is translated into an analog signal (baseband) – ASK, FSK, PSK -‐ main focus here – differences in spectral efficiency, power efficiency, robustness
• Analog modulaJon – shits center frequency of baseband signal up to the radio carrier
• MoJvaJon – smaller antennas (e.g., λ/4) – Frequency Division MulJplexing – medium characterisJcs
• Basic schemes – Amplitude ModulaJon (AM) – Frequency ModulaJon (FM) – Phase ModulaJon (PM)
Modulation and demodulation
synchronizaJon decision
digital data analog
demodulaJon
radio carrier
analog baseband signal
101101001 radio receiver
digital modulaJon
digital data analog
modulaJon
radio carrier
analog baseband signal
101101001 radio transmi.er
Digital modulation • ModulaJon of digital signals known as Shit Keying • Amplitude Shit Keying (ASK):
– very simple – low bandwidth requirements – very suscepJble to interference
• Frequency Shit Keying (FSK): – needs larger bandwidth
• Phase Shit Keying (PSK): – more complex – robust against interference
1 0 1
t
1 0 1
t
1 0 1
t
9/8/14
15
Quadrature Amplitude Modulation • Quadrature Amplitude ModulaJon (QAM) – combines amplitude and phase modulaJon – it is possible to code n bits using one symbol – 2n discrete levels, n=2 idenJcal to QPSK
• Bit error rate increases with n, but less errors compared to comparable PSK schemes – Example: 16-‐QAM (4 bits = 1 symbol) – Symbols 0011 and 0001 have the same phase φ, but different amplitude a. 0000 and 1000 have different phase, but same amplitude.
0000
0001
0011
1000
Q
I
0010
φ
a
Spread spectrum technology • Problem of radio transmission: frequency dependent fading can wipe out
narrowband signals for duraJon of the interference • SoluJon: spread the narrowband signal into a broadband signal using a
special code – protecJon against narrow band interference
detecJon at receiver
interference spread signal signal
spread interference
f f
power power
Effects of spreading and interference
dP/df
f i)
dP/df
f ii)
sender
dP/df
f
iii)
dP/df
f
iv)
receiver f
v)
user signal broadband interference narrowband interference
dP/df
9/8/14
16
Spreading and frequency selective fading
frequency
channel quality
1 2 3
4
5 6
narrow band signal
guard space
2 2
2 2
2
frequency
channel quality
1
spread spectrum
narrowband channels
spread spectrum channels
DSSS (Direct Sequence Spread Spectrum) • XOR of the signal with pseudo-‐random number (chipping
sequence) – many chips per bit (e.g., 128) result in higher bandwidth of the signal
user data
chipping sequence
resulJng signal
0 1
0 1 1 0 1 0 1 0 1 0 0 1 1 1
XOR
0 1 1 0 0 1 0 1 1 0 1 0 0 1
=
tb
tc
tb: bit period tc: chip period
FHSS (Frequency Hopping Spread Spectrum)
• Discrete changes of carrier frequency – sequence of frequency changes determined via pseudo random number
sequence • Two versions
– Fast Hopping: several frequencies per user bit
– Slow Hopping: several user bits per frequency
• Advantages – frequency selecJve fading and interference limited to short period – simple implementaJon – uses only small porJon of spectrum at any Jme
• Disadvantages – not as robust as DSSS – simpler to detect
9/8/14
17
FHSS (Frequency Hopping Spread Spectrum)
user data
slow hopping (3 bits/hop)
fast hopping (3 hops/bit)
0 1
tb
0 1 1 t
f
f1
f2
f3
t
td
f
f1
f2
f3
t
td
tb: bit period td: dwell Jme
Cell structure • Implements space division mulJplex
– base staJon covers a certain transmission area (cell) • Mobile staJons communicate only via the base staJon • Advantages of cell structures
– higher capacity, higher number of users – less transmission power needed – more robust, decentralized – base staJon deals with interference, transmission area etc. locally
• Problems – fixed network needed for the base staJons – handover (changing from one cell to another) necessary – interference with other cells
• Cell sizes from some 100 m in ciJes to, e.g., 35 km on the country side (GSM) -‐ even less for higher frequencies
Frequency planning I • Frequency reuse only with a certain distance between the
base staJons • Standard model using 7 frequencies: • Fixed frequency assignment:
– fixed channel allocaJon (FCA) – certain frequencies are assigned to a certain cell – problem: different traffic load in different cells
• Dynamic frequency assignment: – borrowing channel allocaJon (BCA) – Dynamic channel allocaJon (DCA) – base staJon chooses frequencies depending on the frequencies already used in neighbor cells
– more capacity in cells with more traffic – assignment can also be based on interference measurements
f4 f5
f1 f3
f2
f6
f7
f3 f2
f4 f5
f1
9/8/14
18
Frequency planning II
f1 f2
f3 f2
f1
f1
f2
f3 f2
f3 f1
f2 f1
f3 f3
f3 f3
f3
f4 f5
f1 f3
f2
f6
f7
f3 f2
f4 f5
f1 f3
f5 f6
f7 f2
f2
f1 f1 f1 f2 f3
f2 f3
f2 f3 h1
h2 h3 g1
g2 g3
h1 h2 h3 g1
g2 g3
g1 g2 g3
3 cell cluster
7 cell cluster
3 cell cluster with 3 sector antennas
Cell breathing • CDM systems: cell size depends on current load
• AddiJonal traffic appears as noise to other users
• If the noise level is too high users drop out of cells