Exercises Routing - Intranet...
Transcript of Exercises Routing - Intranet...
What is the difference between a proactive routing protocol and a reactive routing protocol?
Consider the following WSN scenarios and explain why you would choose either a proactive or a reactive routing solution:1. A WSN is used to monitor air pollution in a city where every
sensor reports its sensor data once every minute to a single remote base station. Most sensors are mounted on lamp posts, but some are also mounted on citybuses.
2. A WSN is used to measure humidity in a field, where low-power sensors report measurements only when certain thresholds are exceeded.
3. A WSN is used to detect the presence of vehicles, where each sensor locally records the times of vehicle detection. These records are delivered to the base station only when the sensor is explicitly queried.
Question 1
Scenario 1: A WSN is used to monitor air pollution in a city where every sensorreports its sensor data once every minute toa single remote base station. Most sensorsare mounted on lamp posts, but some are also mounted on city buses
Most of the sensors are static, applicationrequires periodical traffic. I would choose a proactive approach.
Answer
Scanario 2: A WSN is used to measure humidity in a field, where low-power sensors report measurements only when certain thresholds are exceeded.
It’s a event-driven communication paradigm, the application does not seem to have real-time requirements. I would choose a reactive approach.
Answer
Scenario 3: A WSN is used to detect the presence of vehicles, where each sensor locally records the times of vehicle detection. These records are delivered to the base station only when the sensor is explicitly queried.
Communication is completely asynchronous. I would choose a reactive approach.
Answer
For the given network topology find the optimal routes from A to M under the following criteria. The numbers X/Y aside each link represent the latency and the energy budget to transmit a single packet. The other number Z below each node is the residual energy capacity. Minimum Number of hops Minimum Energy consumed per packet Shortest Latency Maximum Minimum Energy Capacity
Exercise 2
Minimum Number of Hops
It is easy to see that the path with minimum number of hops is:
A-E-G-J-M
The path has the following features:
Total latency: 1+3+1+5=10
Total Energy Consumption: 2+3+3+5=13
Solution
Minimum Energy Consumed per packet
We have to find the shortest path on a graph whose edges are weighted with the consumed energy
Solution
5
2
1 11 1
1
2 3
2
2
3
1 2 1
2
1
5
Short Digression on Shortest Paths
The problem has polynomial complexity in the number of nodes
Given G(N,A) and two nodes iand j, find the path with
minimum length
Property:
If node k is traversed by the shortest path from i to j, also the path from i to k is the shortest
Most Common Algorithms Bellman-Ford (basic)
Assumptions: positive/negative weights
Complexity: O(N3)
Dijkstra (basic)
Assumptions: only positive weights
Complexity: O(N2)
Dijkstra Algorithms
Assumptions: Positive weighted edges
Target: Find out the shortest paths from a source (1) and
all the other nodes
Initialization:
dij= if the edge i-j does not exist
1 ,0
,1
1
)0(
1
jdDD
P
jj
Dijkstra Algorithm
1. To Go 3.
min,min
:set Pin nodeany ofneighbor each for 2.
STOP. then , If .
set and
min
: find 1.
)(
kjkPk
jj
jPNj
i
dDDD
(N-P)j
NPiPP:
DD
(N-P)i
Dijkstra in practice
Each node is assigned a label (n, L) where n is the next hop on the path and L is the current minimum path length
At each algorithm step, each node neighboring with any node in P updates its label looking at its P-neighbors’ labels
At each algorithm step, the node with the lowest minimum path length is added to set P
When all the nodes are in P shortest path tree can be built
The min-energy route is: A-E-F-G-H-K-M
Solution
A E G J M
C
B
D
F
H
I
K
L
5
2
1 11 1
1
2 3
2
2
3
1 21
2
1
5
(-, )
(-, )(-, )
(-, )
(-, )(-, )(-, )
(-, )
(-, )
(-, ) (-, )
(-, )
(M, 2)
(M, 1)
(M, 5)(L, 3)
(M, 2)
(H, 5)
(J, 4)
(H, 5)
(E, 9)
(E, 8)
(G, 7)
(G, 6)
(G, 8)(F, 7)
(G, 7)
(E, 9)
(A, 10)
(M, 0)
(L, 3)
(K, 3)
(K, 3)
(J, 4)
(D, 12)
(F, 7)
Shortest Latency: the solution is similar to the previous case. The weights to be considered in the shortest path calculation change.
The latency-optimal route is: A-E-G-J-L-M
Solution
Maximum Minimum Energy Capacity
We can proceed as follows: 1. Sol=Null
2. Find a path, P, from A to M. S=P
3. Eliminate the node(s) (and incident links) with the lowest energy budget
4. If, in the resulting graph, A and M are not connected, return S, else go to 2
Solution
Alternative approach:
Node G “must” be in the route
Eliminate all the nodes which have lower energy budget than G
If a path between A and M exists, that’s the one with maximum minimum energy capacity
Solution
A WSN has a 5x5 grid topology. Nodes cancommunicate only with neighboring nodes.A packet transmission or forwarding costs 1unit of energy (null consumption due toprocessing and reception). Find the energyoptimal routes for both topologies.
Exercise 3
Being the energy cost equal to 1, finding the minimum energy tree is equivalent to finding the min-hop shortest path tree
Solution
Consider the following network topologies. What is the average and total loadin the network when the per-node load is calculated as the number of routeseach node has to service (including its own)
What is the network lifetime of both topologies if: A node transmits in 1 second time frame its packet and all the packets it has received
from its neighbors in the previous second Each node has a energy budget of 100 Each transmission costs 1 Null reception and processing energy
Exercise 4
The average per-node load can be obtained by counting the traffic instances each node manages.
The total load is 68 and 112 respectively
The average load is 2.8 and 4.6 respectively
Solution
The network lifetime can be calculated looking at the bottleneck nodes
Solution
1pkt 4pkt 8pkt 12pkt 12pkt …….
99 95 87 75 63 ………
Time
Tx
ResEnergy
1pkt 2pkt 3pkt 5pkt 8pkt 12pkt 15pkt 17pkt…
99 97 94 89 81 69 55 38….
Time
Tx
ResEnergy
The two bottleneck nodes will die out during the 11-th second
Exercise 5
Consider the WSN reported in the figure. Suppose the WSN is operated by the RPL protocol. Links among nodes represent reachability and numbers aside each link represent the corresponding ETX Find a DODAG routed in A which is built
with following objective function: “To minimize the ETX along the established paths”
Find a tree routed in A built according to the following routing objective function: “To minimize the ETX along the established paths under the constraints that the minimum per-link ETX is lower than 2”
A
B C
E FD
321.2
1
3
1
1.5
4
Find a DODAG routed in A which is built with following objective function: “To minimize the cumulative ETX along the established paths”
Solution
A
B C
E FD
321.2
1
3
1
1.5
4
A
B C
E FD
321.2
1
3
1
1.5
4
Find a tree routed in A built according to the following routing objective function: “To minimize the ETX along the established paths under the constraints that the minimum per-link ETX is lower than 2”
All the links with ETX higher than 2 don’t have to be considered for routing
Solution
A
B C
E FD
321.2
1
3
1
1.5
4
A
B C
E FD
21.2
1 1
1.5
The resulting graph isalready a tree
A routing protocol for WSNs leverages the expected transmission count (ETX) as a routing metric. To this end, two nodes, A and B, at the vertices of a link probe the quality of the link by sending out 100 [byte] probing packets which are acknowledged (if correctly received) through explicit ACKs of 10 [byte].
Assuming that the Bit Error Rate (BER) is p=0.005 in both directions, find out the ETX measure for the link (assume independent errors bit by bit)
Exercise 6
Since bits are independent, the probability of correct reception of a packet of L bits is: 1-P= (1-p)L
The packet error probability is: P= 1-(1-p)L = .98
The ACK error probability is: Q=1-(1-p)Lack= .33
Solution
A B
The ETX for the link is the average number of packet retransmission (including the first transmission) to let the packet go through.
The transmission success probability can be expressed as: P*=(1-P)(1-Q)
Thus:
Therefore, the ETX is: 1/P*=74.6
Solution
k
k
PPk
PPPPPETX
0
**
2*****
)1()1(
..)1(3)1(2
Under the same parameters as the previous exercise, find out the expected transmission time (ETT) for the previous link, that is, the average amount of time taken by a transmission to go through.
Assume a link capacity (bidirectional) of 250 [kb/s] and null
processing time Propagation delay t=10 [us] After a failed transmission, the retransmission is
performed exactly after a round trip time
Comment on similarities/differences, pros/cons of ETX and ETT
Exercise 7