INET Framework for OMNeT++/OMNEST
|
This class implements the Greedy Perimeter Stateless Routing for Wireless Networks. More...
#include <GPSR.h>
Public Member Functions | |
GPSR () | |
virtual | ~GPSR () |
Public Member Functions inherited from inet::ILifecycle | |
virtual | ~ILifecycle () |
Public Member Functions inherited from inet::INetfilter::IHook | |
virtual | ~IHook () |
Protected Member Functions | |
virtual int | numInitStages () const override |
void | initialize (int stage) override |
void | handleMessage (cMessage *message) override |
Private Member Functions | |
void | processSelfMessage (cMessage *message) |
void | processMessage (cMessage *message) |
void | scheduleBeaconTimer () |
void | processBeaconTimer () |
void | schedulePurgeNeighborsTimer () |
void | processPurgeNeighborsTimer () |
void | sendUDPPacket (UDPPacket *packet, double delay) |
void | processUDPPacket (UDPPacket *packet) |
GPSRBeacon * | createBeacon () |
void | sendBeacon (GPSRBeacon *beacon, double delay) |
void | processBeacon (GPSRBeacon *beacon) |
GPSROption * | createGpsrOption (L3Address destination, cPacket *content) |
int | computeOptionLength (GPSROption *gpsrOption) |
void | setGpsrOptionOnNetworkDatagram (INetworkDatagram *datagram) |
void | removeGpsrOptionFromNetworkDatagram (INetworkDatagram *datagram) |
GPSROption * | findGpsrOptionInNetworkDatagram (INetworkDatagram *datagram) |
const GPSROption * | findGpsrOptionInNetworkDatagram (INetworkDatagram *datagram) const |
GPSROption * | getGpsrOptionFromNetworkDatagram (INetworkDatagram *datagram) |
const GPSROption * | getGpsrOptionFromNetworkDatagram (INetworkDatagram *datagram) const |
bool | isNodeUp () const |
void | configureInterfaces () |
Coord | getDestinationPosition (const L3Address &address) const |
Coord | getNeighborPosition (const L3Address &address) const |
double | getDestinationAngle (const L3Address &address) |
double | getNeighborAngle (const L3Address &address) |
std::string | getHostName () const |
L3Address | getSelfAddress () const |
L3Address | getSenderNeighborAddress (INetworkDatagram *datagram) const |
simtime_t | getNextNeighborExpiration () |
void | purgeNeighbors () |
std::vector< L3Address > | getPlanarNeighbors () |
L3Address | getNextPlanarNeighborCounterClockwise (const L3Address &startNeighborAddress, double startNeighborAngle) |
L3Address | findNextHop (INetworkDatagram *datagram, const L3Address &destination) |
L3Address | findGreedyRoutingNextHop (INetworkDatagram *datagram, const L3Address &destination) |
L3Address | findPerimeterRoutingNextHop (INetworkDatagram *datagram, const L3Address &destination) |
Result | routeDatagram (INetworkDatagram *datagram, const InterfaceEntry *&outputInterfaceEntry, L3Address &nextHop) |
virtual Result | datagramPreRoutingHook (INetworkDatagram *datagram, const InterfaceEntry *inputInterfaceEntry, const InterfaceEntry *&outputInterfaceEntry, L3Address &nextHop) override |
This is the first hook called by the network protocol before it routes a datagram that was received from the lower layer. More... | |
virtual Result | datagramForwardHook (INetworkDatagram *datagram, const InterfaceEntry *inputInterfaceEntry, const InterfaceEntry *&outputInterfaceEntry, L3Address &nextHop) override |
This is the second hook called by the network protocol before it sends a datagram to the lower layer. More... | |
virtual Result | datagramPostRoutingHook (INetworkDatagram *datagram, const InterfaceEntry *inputInterfaceEntry, const InterfaceEntry *&outputInterfaceEntry, L3Address &nextHop) override |
This is the last hook called by the network protocol before it sends a datagram to the lower layer. More... | |
virtual Result | datagramLocalInHook (INetworkDatagram *datagram, const InterfaceEntry *inputInterfaceEntry) override |
This is the last hook called by the network protocol before it sends a datagram to the upper layer. More... | |
virtual Result | datagramLocalOutHook (INetworkDatagram *datagram, const InterfaceEntry *&outputInterfaceEntry, L3Address &nextHop) override |
This is the first hook called by the network protocol before it routes a datagram that was received from the upper layer. More... | |
virtual bool | handleOperationStage (LifecycleOperation *operation, int stage, IDoneCallback *doneCallback) override |
Perform one stage of a lifecycle operation. More... | |
virtual void | receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override |
Static Private Member Functions | |
static Coord | intersectSections (Coord &begin1, Coord &end1, Coord &begin2, Coord &end2) |
static double | getVectorAngle (Coord vector) |
Private Attributes | |
GPSRPlanarizationMode | planarizationMode = (GPSRPlanarizationMode)-1 |
const char * | interfaces = nullptr |
simtime_t | beaconInterval |
simtime_t | maxJitter |
simtime_t | neighborValidityInterval |
cModule * | host = nullptr |
NodeStatus * | nodeStatus = nullptr |
IMobility * | mobility = nullptr |
IL3AddressType * | addressType = nullptr |
IInterfaceTable * | interfaceTable = nullptr |
const char * | outputInterface = nullptr |
IRoutingTable * | routingTable = nullptr |
INetfilter * | networkProtocol = nullptr |
int | positionByteLength = -1 |
cMessage * | beaconTimer = nullptr |
cMessage * | purgeNeighborsTimer = nullptr |
PositionTable | neighborPositionTable |
Static Private Attributes | |
static PositionTable | globalPositionTable |
Additional Inherited Members | |
Public Types inherited from inet::INetfilter::IHook | |
enum | Type { PREROUTING, LOCALIN, FORWARD, POSTROUTING, LOCALOUT } |
enum | Result { ACCEPT, DROP, QUEUE, STOLEN } |
This class implements the Greedy Perimeter Stateless Routing for Wireless Networks.
The implementation supports both GG and RNG planarization algorithms.
For more information on the routing algorithm, see the GPSR paper http://www.eecs.harvard.edu/~htk/publication/2000-mobi-karp-kung.pdf
|
virtual |
|
private |
Referenced by createGpsrOption().
|
private |
Referenced by handleOperationStage(), and initialize().
|
private |
Referenced by processBeaconTimer().
|
private |
Referenced by setGpsrOptionOnNetworkDatagram().
|
inlineoverrideprivatevirtual |
This is the second hook called by the network protocol before it sends a datagram to the lower layer.
This is done after the datagramPreRoutingHook or the datagramLocalInHook is called and the datagram is routed.
Implements inet::INetfilter::IHook.
|
inlineoverrideprivatevirtual |
This is the last hook called by the network protocol before it sends a datagram to the upper layer.
This is done after the datagramPreRoutingHook is called and the datagram is routed.
Implements inet::INetfilter::IHook.
|
overrideprivatevirtual |
This is the first hook called by the network protocol before it routes a datagram that was received from the upper layer.
The nextHopAddress is ignored when the outputInterfaceEntry is a nullptr. After this is done
Implements inet::INetfilter::IHook.
|
inlineoverrideprivatevirtual |
This is the last hook called by the network protocol before it sends a datagram to the lower layer.
Implements inet::INetfilter::IHook.
|
overrideprivatevirtual |
This is the first hook called by the network protocol before it routes a datagram that was received from the lower layer.
The nextHopAddress is ignored when the outputInterfaceEntry is nullptr.
Implements inet::INetfilter::IHook.
|
private |
Referenced by getGpsrOptionFromNetworkDatagram().
|
inlineprivate |
Referenced by findGpsrOptionInNetworkDatagram().
|
private |
Referenced by findNextHop(), and findPerimeterRoutingNextHop().
|
private |
Referenced by routeDatagram().
|
private |
Referenced by findGreedyRoutingNextHop(), and findNextHop().
|
private |
Referenced by findPerimeterRoutingNextHop().
Referenced by createGpsrOption(), and getDestinationAngle().
|
private |
Referenced by findGreedyRoutingNextHop(), findNextHop(), findPerimeterRoutingNextHop(), getSenderNeighborAddress(), and routeDatagram().
|
inlineprivate |
Referenced by getGpsrOptionFromNetworkDatagram().
|
private |
|
private |
Referenced by findPerimeterRoutingNextHop(), and getNextPlanarNeighborCounterClockwise().
Referenced by findPerimeterRoutingNextHop(), and getNeighborAngle().
|
private |
Referenced by schedulePurgeNeighborsTimer().
|
private |
Referenced by findPerimeterRoutingNextHop().
|
private |
Referenced by getNextPlanarNeighborCounterClockwise().
|
private |
Referenced by computeOptionLength(), createBeacon(), findGreedyRoutingNextHop(), findPerimeterRoutingNextHop(), initialize(), processBeaconTimer(), routeDatagram(), and sendBeacon().
|
private |
Referenced by findPerimeterRoutingNextHop().
|
staticprivate |
Referenced by getDestinationAngle(), and getNeighborAngle().
|
overrideprotected |
|
overrideprivatevirtual |
Perform one stage of a lifecycle operation.
Processing may be done entirely within this method, or may be a longer process that involves nonzero simulation time or several events, and is triggered by this method call.
Return value: true = "done"; false = "not yet done, will invoke doneCallback when done"
Implements inet::ILifecycle.
|
overrideprotected |
|
staticprivate |
Referenced by findPerimeterRoutingNextHop().
|
private |
Referenced by initialize().
|
inlineoverrideprotectedvirtual |
|
private |
Referenced by processUDPPacket().
|
private |
Referenced by processSelfMessage().
|
private |
Referenced by handleMessage().
|
private |
Referenced by processSelfMessage().
|
private |
Referenced by handleMessage().
|
private |
Referenced by processMessage().
|
private |
Referenced by processPurgeNeighborsTimer().
|
overrideprivatevirtual |
|
private |
|
private |
Referenced by datagramLocalOutHook(), and datagramPreRoutingHook().
|
private |
Referenced by initialize(), and processBeaconTimer().
|
private |
Referenced by initialize(), processBeaconTimer(), and processPurgeNeighborsTimer().
|
private |
Referenced by processBeaconTimer().
|
private |
Referenced by sendBeacon().
|
private |
Referenced by datagramLocalOutHook().
|
private |
Referenced by configureInterfaces(), initialize(), and sendBeacon().
|
private |
Referenced by initialize(), and scheduleBeaconTimer().
|
private |
Referenced by handleOperationStage(), initialize(), processSelfMessage(), scheduleBeaconTimer(), and ~GPSR().
|
staticprivate |
Referenced by getDestinationPosition(), initialize(), and processBeaconTimer().
|
private |
Referenced by getHostName(), and initialize().
|
private |
Referenced by configureInterfaces(), and initialize().
|
private |
Referenced by configureInterfaces(), getSelfAddress(), initialize(), and routeDatagram().
|
private |
Referenced by initialize(), and processBeaconTimer().
|
private |
|
private |
|
private |
Referenced by getNextNeighborExpiration(), initialize(), and purgeNeighbors().
|
private |
Referenced by initialize().
|
private |
Referenced by initialize(), and isNodeUp().
|
private |
Referenced by initialize(), and routeDatagram().
|
private |
Referenced by getPlanarNeighbors(), and initialize().
|
private |
Referenced by computeOptionLength(), createBeacon(), and initialize().
|
private |
Referenced by handleOperationStage(), initialize(), processSelfMessage(), schedulePurgeNeighborsTimer(), and ~GPSR().
|
private |
Referenced by datagramLocalOutHook(), datagramPreRoutingHook(), getSelfAddress(), and initialize().