Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Reserved.
modification, are permitted provided that the following conditions are met:
3. The name of the author may not be used to endorse or promote products
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
The AODV code developed by the CMU/MONARCH group was optimized and tuned by Samir Das and
Mahesh Marina, University of Cincinnati. The work was partially done in Sun Microsystems.
*/
#ifndef __aodv_h__
#define __aodv_h__
//#include <agent.h>
//#include <packet.h>
//#include <sys/types.h>
//#include <cmu/list.h>
//#include <scheduler.h>
#include <cmu-trace.h>
#include <priqueue.h>
#include <aodv/aodv_rtable.h>
#include <aodv/aodv_rqueue.h>
#include <classifier/classifier-port.h>
/*
*/
#define AODV_LOCAL_REPAIR
/*
*/
#define AODV_LINK_LAYER_DETECTION
/*
Causes AODV to apply a "smoothing" function to the link layer feedback
is considered bad.
*/
#define AODV_USE_LL_METRIC
/*
from 802.11. This may be flawed, because it does not account for
congestion.
*/
//#define AODV_USE_GOD_FEEDBACK
class AODV;
// MAX_RREQ_TIMEOUT sec.
#define RREQ_RETRIES 3
#define TTL_START 5
#define TTL_THRESHOLD 7
#define TTL_INCREMENT 2
// Must be larger than the time difference between a node propagates a route
// The followings are used for the forward() function. Controls pacing.
// think it should be 30 ms
#define ARP_DELAY 0.01 // fixed delay to keep arp happy
/*
*/
public:
BroadcastTimer(AODV* a) : agent(a) {}
void handle(Event*);
private:
AODV *agent;
Event intr;
};
public:
HelloTimer(AODV* a) : agent(a) {}
void handle(Event*);
private:
AODV *agent;
Event intr;
};
class NeighborTimer : public Handler {
public:
NeighborTimer(AODV* a) : agent(a) {}
void handle(Event*);
private:
AODV *agent;
Event intr;
};
public:
RouteCacheTimer(AODV* a) : agent(a) {}
void handle(Event*);
private:
AODV *agent;
Event intr;
};
public:
LocalRepairTimer(AODV* a) : agent(a) {}
void handle(Event*);
private:
AODV *agent;
Event intr;
};
/*
Broadcast ID Cache
*/
class BroadcastID {
public:
protected:
LIST_ENTRY(BroadcastID) link;
nsaddr_t src;
u_int32_t id;
};
LIST_HEAD(aodv_bcache, BroadcastID);
/*
*/
/*
*/
public:
AODV(nsaddr_t id);
protected:
/*
*/
double expire_time);
public:
protected:
void rt_purge(void);
/*
* Neighbor Management
*/
void nb_purge(void);
/*
* Broadcast ID Management
*/
void id_purge(void);
/*
* Packet TX Routines
*/
void sendHello(void);
* Packet RX Routines
*/
/*
* History management
*/
/*
* Timers
*/
BroadcastTimer btimer;
HelloTimer htimer;
NeighborTimer ntimer;
RouteCacheTimer rtimer;
LocalRepairTimer lrtimer;
/*
* Routing Table
*/
aodv_rtable rtable;
/*
*/
aodv_rqueue rqueue;
/*
* table.
*/
Trace *logtarget;
/*
*/
PriQueue *ifqueue;
/*
* Logging stuff
*/
PortClassifier *dmux_;
};
#endif /* __aodv_h__ */