IOT Module 3
IOT Module 3
4. Modulation
How do we encode data on RF?
What is light?
What is light?
Lower Higher
frequency frequency
What is light?
Lower Higher
frequency frequency
Wavelength 103 102 101 1 10-1 10-2 10-3 10-4 10-5 10-6 10-7 10-8 10-9 10-10 10-11 10-12
(in meters)
Common name
of wave ULTRAVIOLET
VISIBLE
INFRARED
Wavelength 103 102 101 1 10-1 10-2 10-3 10-4 10-5 10-6 10-7 10-8 10-9 10-10 10-11 10-12
(in meters)
Size of
Wavelength Soccer
House
field Baseball Bee Animal Bacteria Virus Water
Cell Molecule
Common name
of wave ULTRAVIOLET “HARD” X-RAYS
VISIBLE
INFRARED
Wavelength 103 102 101 1 10-1 10-2 10-3 10-4 10-5 10-6 10-7 10-8 10-9 10-10 10-11 10-12
(in meters)
Size of
wavelength Soccer
House
field Baseball Bee Animal Bacteria Virus Water
Cell Molecule
Common name
of wave ULTRAVIOLET “HARD” X-RAYS
VISIBLE
RADIO WAVES INFRARED
Digital Information
110101101 Antenna
101010101010101010101010101010
0 1 0 1 0 101010101010101010101010101010
RF Transmitter Architecture
Digital Information
110101101 Antenna
0 1 0 1 0
0 1 0 1 0 0 1 0 1 0
RF Transmitter Architecture
Mixer
PLL
Mixer
PLL
Mixer
PLL
4. Modulation
How do we encode
data on RF?
“Polarization” of EM Waves
• You don’t know how your users are polarized propagate signals
for both
• Some APs propagate two polarizations
• Can manually configure antennas
• Also covers vertical and horizontal space
Radiation Patterns
Radiation Patterns
4. Modulation
How do we encode
data on RF?
Signal Propagation
What happens to radio waves between antennas?
Wavelength 103 102 101 1 10-1 10-2 10-3 10-4 10-5 10-6 10-7 10-8 10-9 10-10 10-11 10-12
(in meters)
Size of
wavelength Soccer
House
field Baseball Bee Animal Bacteria Virus Water
Cell Molecule
Common name
of wave ULTRAVIOLET “HARD” X-RAYS
VISIBLE
RADIO WAVES INFRARED
Fog
H2 O Excessive Rain
O2
Heavy Rain
O2
Drizzle
H2 O
Air
1 101 102 103 104 105 106 107 108 109 1010 1011 1012 1013 1014
(Hz) (kHz) (MHz) (GHz) (THz)
RADIO WAVES INFRARED
MICROWAVES
• Online calculator:
https://www.everythingrf.com/rf-calculators/fresnel-zone-calculator
How Physical Objects Affect Wireless
Signals
• Different materials affect
reflection/absorption/
refraction in different
ways
• 802.11 supports
different
“channels”/
wavelengths
• Put nearby APs
on different
wavelengths
General Problem: Graph Coloring
Channel 7 Channel 3
Channel 3
Channel 3
Channel 2 Channel 2
Channel 3
Channel 3
Channel 7 Channel 7
4. Modulation
How do we encode
data on RF?
How do we encode data in wireless
signals?
• Need to generate signals to transmit data
• Challenges:
• Low bandwidth
• Propagation channel impairments (noise, multipath,
interference, etc.)
• Simplicity/cost of hardware
• Remember that we send using a carrier signal
• Options for modulation: Amplitude, frequency, phase
Amplitude Shift Keying (ASK)
1 0 1 0 1
Amplitude Shift Keying (ASK)
1 0 1 0 1
1 0 1 0 1
Frequency Shift Keying (FSK)
1 0 1
1 0 1 0
Phase Shift Keying (PSK) 90°
1 0 1 0
1 0
180° 0°
phase
270°
1 0
180° 0°
amplitude
phase
270°
Constellation Diagram
90°
01
10 00
180° 0°
* amplitude
phase
270°
Common Phase-Amplitude Modulations
BPSK, QPSK,
Modulation ASK FSK QPSK
QAM
2. Power-saving algorithms
What if a node transmits
but the destination is
sleeping?
Collision!
Collision Detection (Wired, Small Packets)
0:022 Finished transmitting packet
successfully! Start transmitting 0:016 Collision detected! Start
next packet. 0:016 Collision detected! Start ignoring packet.
0:000 Packet transmission ignoring packet. 0:008 Packet transmission
begins. begins.
Collision!
Collision Detection, Wireless
-65dB (minimum
signal strength for
applications that
require reliable,
timely
delivery)
“Hidden Node” problem – device may be visible to an AP but not to other
-70dB (minimum
signal strength for
nodes communicating with that AP reliable delivery)
On top of that, most radios are functionally half-duplex
• Transmitted signal much louder than received signal, can’t hear collisions
I just saw an
I just
ACK– saw a CTS –
whoever
Collision Avoidance (CA), Wireless someone
was
before
else
transmitting
was allocated
is done,the
so
I canchannel
send a –RTSI if
should
I need to not
send
transmit anything
packets.
ACK
2. Power-saving algorithms
What if a node transmits
but the destination is
sleeping?
• Questions:
• How long to make active, sleep durations?
• How long does a node have to “wait” in active state?
Non-beacon Tracking (NBT ): Downsides
• What if beacons collide?
• Regular schedule they’d continually collide
• Idea: Restart beaconing after random delay, if detect another node’s
beacon during active window
• Doesn’t always work: Collision may happen outside radio range (hidden
terminal)
• Issues:
• Synchronized clocks, increase hardware costs
• What if beacon can’t be heard by entire network (multihop network)?
What if beacon can’t be heard by entire
network (multihop network)?
• Solution: Other nodes
also send beacons
D
F
• 802.15.4: Nodes form
an “association tree”
G
H J
• Nodes wake up for
parents in tree
Outgoing
active
Beacon Tracking: Multihop Case duration
Ack
D
Node A
(level i)
Data arrival (dest=A) Data
C
Node B
(level i+1)
A
Node C
(level i+1)
Coordinator B
Node D
(level i+2)
Each node
• Issue: Nodeshas active
have durations
to idle for incoming
listen every and outgoing
superframe duration even
beacons+data
if they have no data to send
Incoming:
• Also, Beaconsselection
coordinator from controller oneincreases
procedure level up complexity,
• synchronized clocksto
Outgoing: Beacons increase
childrenhw costs
one level down
MAC Power Saving Algorithms
IEEE 802.15.4
(Zigbee, Z-Wave, 6LoWPAN, etc)
Z Z Node A
Z
Z Z
Z
A B
Node B
I Ok,
don’tI have
knowbeen transmitting
if A is awake. But
IWRs
know forfor
twisure
timeitunits. NodeupA
will wake Wakeup interval (twi)
Write
*must* be receiving
within the them
next twi time now.
units! Request
I can transmit data now! Data arrives Data
Z Z Node A
Z
Z Z
Z
A B
Node B
Write
Request Data
Data arrives
Z Z Node A
Z
Z Z
Z
A B
Node B
IIknow
received a Write
node A isn’tAck at this
awake. Buttime,
I
so I aknow
know timenode
whenAitwill
willbe
beawake
awake,at
Write Scheduled
now+tIwiknow
because (andhow
everylong
additional
I’ve slept twi
Request
Data Wakeup Data
since the lastafter that).
Write Ack from A. Data arrives
2. Power-saving algorithms
What if a node transmits
but the destination is
sleeping?
SSIDs:
xfinitywifi
SSIDs:
VFCorp,
VFGuest
SSIDs:
M1-Enclave-Wireless
Probe request
Probe response AP Discovery
Association request
Association response Association
Data
Data
2. Traditional Routing
How can nodes discover
paths across intermediate hops?
3. Mesh Routing
How to route in dynamic,
unstable wireless environment?
Motivating Scenario
• Distribute a bunch of nodes
in some environment
• Home, field, zoo, building
• Need to collect data,
monitor
• No (reliable) wireless
infrastructure
• They need to work together
to do things
Mesh Networking
• Networking elements cooperatively connect directly,
dynamically, and non-hierarchically to forward data
• Dynamically self-organize and self-configure
Space networking
Electric smart Smart homes (e.g., Iridium satellite
meters (e.g., Google Home) constellation)
How Routing Works
B K
Q
V
A
Send(msg,Q) S
F
X
J
Area 4
Area 3 4.1
3.2 A 4.2
S 3.3
F
3.1 X
J
2. Geographic addressing
3. Hierarchical addressing
• Downsides: addresses
may be too long, harder
to route on addresses
100
90
Geographic Addressing
80
70
• Assign address based
on GPS or other
60
coordinates (12,56)
(54,38)
(13,7)
mechanism for
coordinate assignment (0,39) (36,39)
40
(59,38)
(e.g., GPS)
• Benefits: can (13,27)
(85,25)
30
(44,25)
sometimes route on (62,22)
addresses, no address
20
needed
• Downsides: addresses
10
D O
J
M
G
Hierarchical Addressing 0-2047
A
0
1-1023 1024-2047
• Organize nodes in a
tree, parent gets B E
1 1024
block of addresses, 2-511 1025-1535 1536-2047
gives itself and D F I
children 2 1025 1536
route on addresses J L K
4 1027 1152
• Downsides: Requires 5-63 1153-1216
tree-like organization, M N
requires advance 5 1153
arrival patterns O
6
7-15
P
7
Hierarchical Addressing:
Zigbee’s Distributed Addressing scheme
• Good for networks that happen to be structured as trees
• Assigns each node a unique 16-bit address
• Approach: Given limit on
• Maximum depth L
• Maximum children per parent C
• Maximum number of forwarding nodes (Routers) R
• The address of the nth child is [parent]+1+n+(n-1)*S(d)
• Where S(d) is the amount of addresses to “skip” at each level:
• If R=1, S(d)=1+C(L-d)
• If R>1, S(d)=(CRL-d-1-1-C-R)/(R-1)
Hierarchical Addressing:
Zigbee’s Distributed Addressing scheme
Example: Coordinator
• Max depth L=2 C d=0
0
• Max routers R=4
• Max children C=3 Routers
S(d)=(CRL-d-1-1-C+R)/(R-1) R1 R2 R3 R4 d=1
1 6 11 16
S(0)=(3*42-0-1-1-3+4)/(4-1)=4
• (Children of level 0 will have a
pool of 4 addresses)
F
I G H I J K L M N O P d=2
S(1)=(3*42-1-1-1-3+4)/(4-1)=1
2 3 4 5 7 8 12 17 18 19 20
• Children of level 1 will have a Leaves
pool of 1 address)
Address of R1: 0+1+0=1
Address of R2: 0+1+1+S(0)=6
Address of R3: 0+1+2+2*S(0)=11
Stochastic Addressing
Yes, I’m
using 137!
That’s my address! I
• Nodes choose random need to let that guy
Problem:
know there’s an
number for address 204 Address conflict!
address conflict.
191
89
• Simple to implement, 133
110
but requires conflict 167
137
resolution to ensure
173 109
uniqueness 162
• Zigbee: broadcast
address on selection, if 188
6
217
a node has a conflict it 159
broadcasts an error
• Collisions more 137
Power
Management
Mesh Routing N/A ? AODV, DSR, AODV, DSR,
Tree Routing Tree Routing
1. Addressing
How to identify
destinations that may be multiple
2. Traditional Routing
How can nodes discover
paths across intermediate hops?
3. Mesh Routing
How to route in dynamic,
unstable wireless environment?
Problem: What if node you want to talk to
isn’t within radio range?
A [C,A]
[D,E]
[C,E]
[C,B]
[A,B]
[B,D]
[E,F]
[D,F] [C,A]
[D,E]
[C,E]
[C,B]
[A,B]
[B,D]
[E,F]
[D,F] [C,A]
[D,E]
[C,E]
[C,B]
[A,B]
[B,D]
[E,F]
[D,F] [C,A]
[D,E]
[C,E]
[C,B]
[A,B]
[B,D]
[E,F]
[D,F] F
[C,A]
[D,E]
[C,E]
[C,B]
[A,B]
[B,D]
[E,F]
[D,F]
[C,A]
[D,E]
[C,E]
[C,B]
[A,B]
[B,D]
[E,F]
[D,F] C E
[C,A]
[D,E]
[C,E]
[C,B]
[A,B]
[B,D]
[E,F]
[D,F]
B D
A F
C E
IP packet A F
source destination
C E
(F,0)
(F,2) C E
(F,1)
Distance Vector: Convergence
Updates
received by A: 0 1 2 3 4 5 6 7
Withdraw(H)
A B D
source
C E F G H
destination
2. Traditional Routing
How can nodes discover
paths across intermediate hops?
3. Mesh Routing
How to route in dynamic,
unstable wireless environment?
Why not use these protocols in wireless?
✓ K
E
A
I✓
F L
✓ O
B H
✓
D
J✓ N
M P
G✓
C • Problem 1: Unicasts to each neighbor
are kind of redundant
• Problem 2: Don’t really need all
neighbors to re-flood message
• Problem 3: May not really need routes
to all nodes
Why not use these protocols in wireless?
K
E
A
I
F L O
B H
D N
J
M P
G
C • Problem 1: Unicasts to each neighbor
are kind of redundant
• Problem 2: Don’t really need all
neighbors to re-flood message
• Problem 3: May not really need routes
to all nodes
Why not use these protocols in wireless?
K
E
A
I
F L O
B H
D N
J
M P
G
C • Problem 1: Unicasts to each neighbor
are kind of redundant
• Problem 2: Don’t really need all
neighbors to re-flood message
• Problem 3: May not really need routes
to all nodes
Why not use these protocols in wireless?
K
E
A
I
F L O
B H
D N
J
M P
G
C • Problem 1: Unicasts to each neighbor
are kind of redundant
• Problem 2: Don’t really need all
neighbors to re-flood message
• Problem 3: May not really need routes
to all nodes
Why not use these protocols in wireless?
K
E
A
I
F L O
B H
D N
J
M P
G
C • Problem 1: Unicasts to each neighbor
are kind of redundant
• Problem 2: Don’t really need all
• Unnecessary transmissions waste neighbors to re-flood message
battery, bandwidth • Problem 3: May not really need routes
to all nodes
• Unnecessary routes waste storage
Solution: Mesh Networking
• Nodes cooperate to efficiently route data
• Nodes can act as relays, enabling multi-hop
forwarding
• Mesh networks dynamically self-organize and
self-configure
• Reduce management and configuration overhead
• Improves fault-tolerance
• Dynamically distributes workloads
Mesh Networking Protocols
1. Optimized Link State Routing (OLSR)
2. Destination-Sequenced Distance Vector (DSDV)
3. Dynamic Source Routing (DSR)
4. Ad Hoc On-demand Distance Vector (AODV)
5. Tree Routing
6. Geographic/Perimeter Routing
7. Gossip Routing
Optimized Link State Routing (OLSR)
• Main idea: Do link state, but avoid unnecessary transmissions of
link state updates
• All nodes will still receive all link state updates
• Algorithm:
• Step 1: Select all nodes in N1(H), which cover isolated points of N2(H)
• Isolated points are nodes that are reachable by only one member of N1(H)
• Step 2: Amongst all unselected nodes in N1(H), select the node, which covers
the maximum number of uncovered nodes in N2(H)
• Step 3: Repeat Step 2 until all nodes are covered
B L P
E
I
C • Step 1:
2: Select
Amongstall nodes in
F N 1(H), which
unselected coverin N1(H),
nodes
isolated
select onepoints
thatof N2(H)
covers
most nodes in N2(H)
Optimized Link State Routing (OLSR):
Forwarding
• Same as regular link state: Build a topology database, run
Dijkstra’s, store shortest-path next-hop for each destination
• However, observe that nodes tend to select higher-connected
nodes as MPRs
• Therefore, nodes tend to select same nodes as MPRs
• MPRs tend to form a smaller “spanning” subgraph of the topology
• Optimization: MPRs forward all traffic, not just link state adverts
• Reduces routing table size
• Allows more nodes to sleep
• But, asymmetric battery usage
• [may want to add an animation here on how Dijkstra’s computes
the tables given the mprs]
Optimized Link State Routing (OLSR):
Forwarding
I
E P
A
K N
F May want to animate packet
forwarding, just for clarity
B H L
D O
J
M
G
What’s wrong with OLSR?
• Great approach, used in some protocols
Control packet
UID SRC DST RTE
format:
Source – node
Route – the source
sending the
route learned by the
RREQ
RREQ
Unique id – used to
Destination –
ensure each message
node the RREQ is
not transmitted more
destined to
than once
Dynamic Source Routing:
Route Request (RREQ)
Intermediate nodes append their
address to the path and forward
update; temporarily cache unique
Data packet id to avoid re-forwarding
3 A M EE I
arrives, triggers 3 A M E 3 A M E 3 A M EFHKNP
RREQ source 3 A M E I
E 3 A M EFHK
3 A M EFHKNP P
3 A M E F H 3K A M 3E F AH KM 3E FAH K
A 3 A M E F MN E F H K N
3 A M 3
3 A M E A M BB F 3 A M E F H K N
3 A M
3 A M B 3 A M B F
3 A M EF
3 A M EFHK
3 A M EFHKN
3 A M E F H3 A M E F H 3 A M EFHL 3 A M EFHKNP
3 A M B 3 A M E F H 3 A M E F H K N
3 A M EF 3 A M EFHL
B H3 A M EFH
L3 A M EFHKN
3 A M BD 3 A M EFHL
RREQ Packet Format:
3 A M B 3 A M EFH 3 A M EFHL
3 A M B D 3 A M BB3D A M E F H 3 A M EFHJ 3 A M EFHKNO
Source – node D 3 A M EFH
O
sending the
Route – the source
3 A M BDG J
RREQ
route learned by the M
RREQ destination
3 A M BD 3 A M BB D
DG I need to reply back to A.
3 A M BDG 3 A M BDG I can do that via the
UID SRC DST RTE
G reverse of the path in the
If Target Address RREQ LHFEA
matches this node’s IP
address, node returns a
Unique id – used to
Destination –
Route Reply (RREP) • Step 1: On data packet arrival,
ensure each message
not transmitted more
node the RREQ is node sends RREQ to discover
than once
destined to path to destination
Dynamic Source Routing:
Route Reply (RREP)
Now I can send my data
packet to M, using the
path AEFHLM
source I
E P
A
K N
F
B H L
RREP Packet Format:
Destination –
• Step 2: Upon receiving an RREQ,
node the RREP
destination returns discovered path back
is destined to to the source in an Route Reply (RREP)
Dynamic Source Routing:
Forwarding
Now I can send my data
packet to M, using the
path AEFHLM
source I
A M EFHL Data E P
A
K N
F
B H L
Data Packet Format:
Source – node D O
sending the
Route being sent J
RREP
back to the M
source destination
Destination –
Payload – data • Step 3: Source can then send data
node the RREP
being sent in
packet
using source route contained in
is destined to RREP
Dynamic Source Routing:
Route Caching
Destination –
The link that
node the RERR
failed
is destined to
Dynamic Source Routing:
Route Error (RERR)
Source – node
Route used to
sending the
reach the source
RERR
source I
E P
A M A
EFHL Data
K N
F
L A EFH L-M
B H L
RERR Packet Format:
Source – node D O
sending the
Route used to J
RERR
reach the source M
destination
What if this link
SRC DST RTE Link
G goes down?
Hello! My name is E,
E: (58,79)
Which next and my coordinates
100
H: (87,57)
E: (58,79)
hopA: should
(40,76)
I are (58,79)
K:E:(107,72) N: (140,71)
F: (70,69) (58,79)
C: (13,61) use?
I: (91,83) I: (91,83) K: (107,72) O: (151,41)
90
F: (70,69) (40,76)
F
79-37=42
D: (56,44)
D: (56,44) (107,72)M: (126,37)
F: (70,69) (140,71)
B: (37,58) (70,69)
C M: (126,37)
60
G: (72,25)
(13,61) B H: (87,57) H H: (87,57)
G: (72,25) L J: (96,40)
N: (140,71)
(87,57) P: (168,80)
(37,58) M: (126,37) L: (120,56)
50
(120,56) O: (151,41)
D D: (56,44)
O
J
40
H: (87,57)
(56,44) J: (96,40)
(96,40)
M (151,41)
126-58=68 (126,37)
30
G
20
(72,25)
10
0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190
Geographic Routing:
Variants of Greedy Forwarding
Greedy Routing: Choose node
with minimum remaining
Compass Routing: Choose distance to destination
node with minimum angle
between node and destination
source
D
C
A M
B
Nearest with Forwarding Most Forwarding Progress within Radius
Progress: Choose nearest node (MFR): Choose node that makes most
that makes progress along progress along straight line distance
straight line distance E
(60,92) G
(107,86)
source
Dest=(121,65) H
A C (116,67) M
(37,58) (70,63) (121,65)
E
(87,57)
B
(56,44)
(60,92) G
(107,86)
source
H
A C (116,67) M
(37,58) (70,63) (121,65)
E Dest=(121,65)
(87,57)
B
(56,44)
(60,92) G
(107,86)
source
H
A C (116,67) M
(37,58) (70,63) (121,65)
E Dest=(121,65)
(87,57)
B
(56,44)
source I
Dest=(126,37) E P
A
K N
F
B H L
D O
J
M
G
Delay-Tolerant Networking:
Geographic Routing
source I
Dest=(126,37) E (91,83) P
A (58,79) (168,80)
(40,76) K N
F (107,72)
(140,71)
(70,69)
B H L
(37,58) (87,57)
(120,56)
D O
(56,44) J
(96,40)
M (151,41)
(126,37)
G
(72,25)
Delay-Tolerant Networking:
Delay-Tolerant Link State Routing
E E
EE I II I
A A
AA K N
B B F F
FF
BB
H H
HH L L
D D L
DD
source I
G G
GG M
E P
A
K N
F K
P
N
B H L
L
O
J M
D O
J
M
• Run link state, but “age out” links when they go down
• Data will flow along paths that will hopefully re-appear in the future
Delay-Tolerant Networking:
Epidemic/Gossip Routing
Data
source Data I
Data E Data P
A Data
K N
F
Data Data
Data
B H L
Data
D Data
O
J
M
Data
• Every node waits random time, picks random target, and sends data
Delay-Tolerant Networking:
Epidemic/Gossip Routing
• If all link failures are transient and reoccurring, message will
eventually reach the destinations
• Will reach all other nodes too – good for multicast/anycast/broadcast
source I
Dest=(126,37) E (91,83) P
A (58,79) (168,80)
(40,76) K N
F (107,72)
(140,71)
(70,69)
B H L
(37,58) (87,57)
(120,56)
D O
(56,44) J
(96,40)
M (151,41)
(126,37)
G
(72,25)
Geographic Routing:
Variants of Greeding Forwarding
source I
E (91,83) P
A (58,79) (168,80)
(40,76) K N
F (107,72)
(140,71)
(70,69)
C
(13,61) B H L
(37,58) (87,57)
(120,56)
D O
(56,44) J
(96,40)
M (151,41)
(126,37)
G
(72,25)
• [why have a destination sequence number ] show a loop?
Tree Routing
• [see page 430 of 9789479493686.pdf]
Near-far problem
We can send data wirelessly – now what?
• We can send data using wireless signals
• That’s not enough
• Need to communicate reliably, need to interpret bits, need to track who
I’m communicating with, need to discover who is there, etc.
• We need to perform more functions atop this communication
• We need protocols
• Next I will talk about IoT protocols
• First, the challenges
• Next, some approaches/algorithms we can use
• Finally I’ll talk about some specific ones
Challenges we need to deal with
• How to communicate with other nodes? (RF Communications)
• How to share the channel (Wireless MAC)
• How to communicate across multiple hops (Wireless Routing)
• Who is out there? (Discovering other nodes)
What are IoT Networks
What are IoT Networks
Some challenges we need to deal with…
B H L
L
O
J M
D O
J
A
E I M
B F
H
D
G
G
E I
A
F E I
B A E I
A
H L F
D B F
B
H L
G D H L
D
G
G M
Protocol Architectures
How do we address these challenges?
• There are a number of IoT protocols out there which have been
created
Node A
Node B
Wakeup interval (twi)
Time A Time C
Data arrives Time B