winter 20021 cmpe 155 week 9. winter 20022 project 8 setting up wireless ad hoc network....
Post on 21-Dec-2015
218 views
TRANSCRIPT
Winter 2002 2
Project 8
Setting up wireless ad hoc network. Designing/implementing application-
level neighbor discovery protocol.
Winter 2002 5
The Physical Layer
Many possible realizations.– Radio transmission range defined by cell.
• “Nanocell”: 6 meters in diameter.
– Receiver within range can hear transmission. – Interaction of multiple transmitters at receiver:
• Collisions: receiver is “in range” of more than one transmitter.
• Capture: receiver in transmission range of 2 transmitters but able to receive cleanly from closer one.
• Interference: receiver is in range of one transmitter and slightly out of range of another transmitter; unable to receive cleanly from closer transmitter due to the other.
Winter 2002 6
MAC approaches
Contention.– More robust.– Good performance under light load.– Example: CSMA
Round-robin.– Token-based.
Reservation.
Winter 2002 7
Carrier Sense Does Not Work
Station avoids collisions by sensing carrier before transmitting.
Relevant contention at the receiver, not sender.– Collision happens when
multiple signals interfere at receiver.
– CS cannot avoid collisions at receiver.
A
B
C
Winter 2002 8
Hidden terminals
B can hear both A and C.
But A and C cannot hear each other.
If A is transmitting to B, and if C starts to transmit, hidden terminal scenario at B.
A
B
C
Winter 2002 9
Exposed terminals
B is sending to A. C is ready to
transmit but detects carrier and defers transmission.
But A is out of C’s range.
A
B
C
Winter 2002 10
Medium Access Collision Avoidance (MACA) Uses 2 short, fixed size signaling
packets: RTS and CTS.– RTS: request-to-send.– CTS: clear-to-send.
Winter 2002 11
MACA
Before sending data, send RTS.
Target responds with CTS.
RTS-generator can then transmit.
Others who hear RTS defer transmission until after CTS.
Stations overhearing CTS defer transmission. – Data packet length in RTS
and CTS messages
If station hears RTS but not CTS, can transmit.
CTS as indication of being in-range of receiver.
If CTS is not heard, or RTS collides:– Retransmit RTS after
binary exponential backoff.– Backoff doubled after each
retransmission.– Goes back to minimum
after success.
Winter 2002 12
Backoff
Can lead to unfairness– Even starvation.
Need to share congestion information.– Backoff copy.
Avoid oscillations in backoff counter.– Increase multiplicatively– Decrease additively– Improves throughput
(less contention)
A
B C
Winter 2002 13
Adding Reliability
Transmission errors:– Noise, collisions, etc.
Add an ACK after DATA transmission– If ACK not received,
sender restarts RTS/CTS again.
– If ACK was lost, receiver sends ACK instead of CTS.
A
B
C
Winter 2002 14
Fairness with RTS/CTS
An exposed terminal may not be able to compete effectively.– Can send RTS but may
not hear CTS.– Doesn’t know if RTS/CTS
was successful. Fix:
– Carrier sense.– …or a DS packet
• Short 30-byte data-sending packet.
A
B
C
Winter 2002 15
IEEE 802.11
Standard for wireless communication.
MAC-layer uses many of the ideas discussed.– RTS/CTS/ACK.– Careful backoff.
Allows two modes– Ad-hoc.– Wired/wireless.
Winter 2002 16
Mobile IP
Internet standard for “last-hop” mobility support in IP networks (RFC 2290).
How do we deliver IP packets when the endpoints move?– Mobile host must be able to communicate
after changing its link-layer point-of-attachment to the Internet.
– Mobile host must be able to communicate using its permanent (home) IP address.
Winter 2002 17
Mobile IP
Issues:– Impact on IP addressing.– Impact on routing.
Key design considerations:– Scale.
• Routing updates (size and frequency).
– Simplicity.– Incremental deployment.
Winter 2002 22
Other Mobile IP Issues
Route optimality– resulting paths can be sub-optimal– can be improved with route optimization
• unsolicited binding cache update to sender
Authentication– registration messages– binding cache updates
Winter 2002 24
MANET Multihop, (wireless), (mobile) ad hoc
network. What does that really mean?
– No fixed network infrastructure.– No distinction between hosts and routers.– All nodes can be traffic sources and
forwarders.
Winter 2002 25
Applications Military applications.
– Battlefield, tanks, boats.
Disaster relief scenarios. Personal area network.
– Communications between personal devices PDA’s, Laptops, Watches, Play Stations.
SoHo (Small office Home office). Business Indoor Applications.
– Exhibitions, Symposiums.– Demos, Meetings.
Winter 2002 26
Issues Mobility
– Widely varying mobility patterns.– Routes can change rapidly.– Does it make sense to use stateful routing
protocols? Power, bandwidth, and processing
capabilities.– May be limited.– Multihop.– Power-aware algorithms.
Winter 2002 28
Ad-Hoc Routing Requirements Distribution paths
– Multi hop paths.– Loop free.– Minimal transmission data overhead.
Self starting and adaptive to dynamic topology.
Low consumption of memory, bandwidth, power.– Scalable with number of nodes.– Localized effects of link failure.
Winter 2002 29
Unicast routing classification
Table Driven - Proactive
Routing Protocols
Source Initiated - On Demand Hybrid
DSDV WRPAODV DSR TORA LAR ZRP DDR
Winter 2002 30
Problems using DV or LS
DV protocols: – May form loops: wasteful in wireless
environment• Bandwidth and power.
– Loop avoidance may be complex LS protocols:
– Higher storage and communication overhead.
Winter 2002 31
Flooding ?
Flooding may deliver packets to too many nodes and in worst case all nodes reachable from sender may receive the packet.
S
R
Winter 2002 32
Alternatives to flooding
Flood only control packets – Use flooding to set up routes and use
established routes for data.– Need to limit flooding as much as
possible.
Winter 2002 33
Proactive protocols Table Driven.
– Maintain consistent, up-to-date routing information from each node to every other node in the network.
– Each node has to maintain one or more tables to store routing information.
– Periodically propagate updates throughout network to account for link changes.
Winter 2002 34
DSDV Destination Sequenced Distance Vector:
– Based on Bellman-Ford algorithm. – Guarantees loop freedom.
Each node maintains routing table.– Next hop.– Cost metrics.– Destination sequence number.– Each node periodically sends its local routing table
with an incremented sequence number.
Winter 2002 35
On-demand protocols AODV
– Primary Objectives• Provide, unicast, broadcast and multicast capability.• Minimize broadcast of control packets.• Disseminate information about link breakages to
neighboring nodes using the link.
– Characteristics• On-demand route creation.
Winter 2002 36
Route Requests in AODV
B
A
S E
F
H
J
D
C
G
IK
Z
Y
Represents a node that has received RREQ for D from S
M
N
L
Winter 2002 37
Route Requests in AODV
B
A
S E
F
H
J
D
C
G
IK
Represents transmission of RREQ
Z
YBroadcast transmission
M
N
L
Winter 2002 38
Route Requests in AODV
B
A
S E
F
H
J
D
C
G
IK
Represents links on Reverse Path
Z
Y
M
N
L
Winter 2002 39
Reverse Path Setup in AODV
B
A
S E
F
H
J
D
C
G
IK
• Node C receives RREQ from G and H, but does not forward it again, because node C has already forwarded RREQ once
Z
Y
M
N
L
Winter 2002 41
Reverse Path Setup in AODV
B
A
S E
F
H
J
D
C
G
IK
Z
Y
• Node D does not forward RREQ, because node D is the intended target of the RREQ
M
N
L
Winter 2002 42
Route Reply in AODV
B
A
S E
F
H
J
D
C
G
IK
Z
Y
Represents links on path taken by RREP
M
N
L
Winter 2002 43
Forward Path Setup in AODV
B
A
S E
F
H
J
D
C
G
IK
Z
Y
M
N
L
Forward links are setup when RREP travels alongthe reverse path
Represents a link on the forward path
Winter 2002 44
Data Delivery in AODV
B
A
S E
F
H
J
D
C
G
IK
Z
Y
M
N
L
Routing table entries used to forward data packet.
Route is not included in packet header.
DATA
Winter 2002 45
Timeouts A routing table entry maintaining a reverse path is
purged after a timeout interval– timeout should be long enough to allow RREP
to come back
A routing table entry maintaining a forward path is purged if not used for a active_route_timeout interval– if no is data being sent using a particular
routing table entry, that entry will be deleted from the routing table (even if the route may actually still be valid)
Winter 2002 46
Link Failure Reporting
A neighbor of node X is considered active for a routing table entry if the neighbor sent a packet within active_route_timeout interval
When the next hop link in a routing table entry breaks, all active neighbors are informed
Link failures are propagated by means of Route Error messages, which also update destination sequence numbers
Winter 2002 47
Link Failure Detection
Hello messages: Neighboring nodes periodically exchange hello message
Absence of hello message is used as an indication of link failure
Alternatively, failure to receive several MAC-level acknowledgement may be used as an indication of link failure
Winter 2002 48
Dynamic Source Routing (DSR) [Johnson96] When node S wants to send a packet to
node D, but does not know a route to D, node S initiates a route discovery
Source node S floods Route Request (RREQ)
Each node appends own identifier when forwarding RREQ
Winter 2002 49
Route Discovery in DSR
B
A
S E
F
H
J
D
C
G
IK
Z
Y
Represents a node that has received RREQ for D from S
M
N
L
Winter 2002 50
Route Discovery in DSR
B
A
S E
F
H
J
D
C
G
IK
Represents transmission of RREQ
Z
YBroadcast transmission
M
N
L
[S]
[X,Y] Represents list of identifiers appended to RREQ
Winter 2002 51
Route Discovery in DSR
B
A
S E
F
H
J
D
C
G
IK
• Node H receives packet RREQ from two neighbors: potential for collision
Z
Y
M
N
L
[S,E]
[S,C]
Winter 2002 52
Route Discovery in DSR
B
A
S E
F
H
J
D
C
G
IK
• Node C receives RREQ from G and H, but does not forward it again, because node C has already forwarded RREQ once
Z
Y
M
N
L
[S,C,G]
[S,E,F]
Winter 2002 53
Route Discovery in DSR
B
A
S E
F
H
J
D
C
G
IK
Z
Y
M
• Nodes J and K both broadcast RREQ to node D• Since nodes J and K are hidden from each other, their transmissions may collide
N
L
[S,C,G,K]
[S,E,F,J]
Winter 2002 54
Route Discovery in DSR
B
A
S E
F
H
J
D
C
G
IK
Z
Y
• Node D does not forward RREQ, because node D is the intended target of the route discovery
M
N
L
[S,E,F,J,M]
Winter 2002 55
Route Reply in DSR
B
A
S E
F
H
J
D
C
G
IK
Z
Y
M
N
L
RREP [S,E,F,J,D]
Represents RREP control message
Winter 2002 56
Data Delivery in DSR
B
A
S E
F
H
J
D
C
G
IK
Z
Y
M
N
L
DATA [S,E,F,J,D]
Packet header size grows with route length
Winter 2002 57
Use of Route Caching
B
A
S E
F
H
J
D
C
G
IK
[P,Q,R] Represents cached route at a node (DSR maintains the cached routes in a tree format)
M
N
L
[S,E,F,J,D][E,F,J,D]
[C,S]
[G,C,S]
[F,J,D],[F,E,S]
[J,F,E,S]
Z