Documente Academic
Documente Profesional
Documente Cultură
Chris Eberz
chriseberz@gmail.com
1. Functionality
Our program simulates a network of nodes that can be either stationary or mobile. The network,
either a randomly generated network based on a random seed provided by the user, or a ring or
star topology, will construct its connections from a simple beaconing protocol wherein each node
broadcasts an empty packet so that all nodes in radio range will cache that node in their routing
table. In each nodes table, neighbors will be dropped if they are not heard from in a specific
amount of time, which, in our program, is tied to the period of beacon packets which is specified
by the user.
Our program allows the user to select from 3 algorithms for forwarding, Greedy forwarding,
GPSR forwarding, and our slightly modified version of GPSR, Ordered Pair GPSR. Once a
routing method is selected, the user may select the number of packets to be sent across the
network (and at what frequency) during the simulation. Once the simulation is finished, the
program outputs metrics to the console, including successfully delivered packets, packets
dropped by the selected routing method, and packets lost during transmission.
Finally, the user can also select if the graph is to move during the simulation. As suggested in
our source, the method we use for moving nodes is the random waypoint method, where a node
chooses a random direction vector (from a range specified by the user), and moves in that
direction in the amount of the magnitude of the vector.
So that the same network, test packets and order of movement could be tested with different
algorithms, all things random in the program are generated by the same user provided seed
mentioned above.
Program variables selected by user:
Network type (Uniform Random, Ring, Star)
Forwarding Algorithm (Greedy, GPSR, Ordered Pair GPSR)
Network size and density
Node radio range
Random Seed
Beacon and test packet periods
Movement and movement range
1
Lp is the node where greedy failed, Lf, first node encountered in that face of the planar graph, and e0 is the edge in
that face that intersects with the line L p D , where D is the destination in the packet.
The GREEDY-FORWARD algorithm looks at the Euclidean distances from each of its
neighbors to the packet destination p.D and picks the one with smallest distance. It then
compares the distance of the closer neighbor with the one from it to p.D, if so happens that the
neighbor is closer; it forwards the packet to that network. But, if none of its neighbors are closer
to p.D than it, then the algorithm returns failure (see Figure 4).
The RIGHT-HAND-FORWARD [2] algorithm implements the right-hand rule method for
traversing polygons, which in our case are the faces in the planar graph. The time complexity of
this algorithm is O(cN) = O(N), where N is the number of neighbors in the planar graph and c is
the time it takes to do a NORM2 operation. NORM can be considered as a constant operation,
since the range of the arc of the tangent is (-/2, /2).
RIGHT-HAND-FORWARD(p, nin)
1
bin = NORM(ATAN2(self.l.y nin.y, self.l.x-nin.x)
2
min = 3
3
for each (a, l) in N do
4
if a == nin then continue
5
ba = NORM(ATAN2(self.l.y l.y, self.l.x l.x))
6
b =
NORM(ba-bin)
7
if b < min then
8
min = b
9
amin = a
10
return amin
2
second time, and the packet would be dropped. In a face made up of nodes that have more than 1
edge, a traversal of the edges repeats with the same direction for each edge. When there is a
node with a single edge, for example a sort of spike, any edges between that node and the first
node with 3 or more edges it touches will be traversed in BOTH directions in the cycle about the
perimeter of the face. If you take these edges and in there place make two directed edges, the
graph is like in the first example where each edge is traversed in the same direction each time.
Thus, any edge that is 2-directional on a face that was traversed first by a packet entering that
face will be traversed in the same direction, unless the packet leaves the face.
3.1. Results
100
95
90
85
Greedy
GPSR
80
OpGPSR
75
70
65
60
50
100
150
200
250
# Nodes
Average # Hops
12
10
Greedy
GPSR
6
OpGPSR
4
2
0
0
50
100
150
# Nodes
200
250
105
100
95
90
85
80
75
Random
Static
Random
Mobile
Ring Static
Ring
Mobile
Topology
100
80
60
40
20
0
Greedy
GPSR
Algorithms for 100 nodes
OpGPSR
4. Conclusions
We have implemented a multi-threaded simulation of the Greedy Perimeter Stateless Routing
protocol for static and mobile wireless sensor networks. We tested the algorithm on different
topologies, and both on static and mobile networks. The Random Waypoint model was used to
simulate sensor network mobility. Our simulations of GPSR imply that GPSR is more scalable
on mobile networks. After studying GPSR in detail, we encountered cases in which the GPSR
Forwarding routing does not find routes when they exist. To handle forwarding failure existing
routes, we proposed the Ordered Pair Greedy Perimeter Stateless Routing protocol. Our
simulation results show that on static sensor networks, Order Pair GPSRs packet transmission
ration is higher than GPSR.
5. References
[1] Karp, B. and Kung, H.T., Greedy Perimeter Stateless Routing for Wireless Networks, in
Proceedings of the Sixth Annual ACM/IEEE International Conference on Mobile Computing and
Networking (MobiCom 2000), Boston, MA, August, 2000, pp. 243-254.
[2] Karp, B., Geographic Routing for Wireless Networks, Ph.D. Dissertation, Harvard
University, Cambridge, MA, October, 2000
10