NetSim Source Code Help
Loading...
Searching...
No Matches
AODV.h
Go to the documentation of this file.
1/************************************************************************************
2* Copyright (C) 2020 *
3* TETCOS, Bangalore. India *
4* *
5* Tetcos owns the intellectual property rights in the Product and its content. *
6* The copying, redistribution, reselling or publication of any or all of the *
7* Product or its content without express prior written consent of Tetcos is *
8* prohibited. Ownership and / or any other right relating to the software and all *
9* intellectual property rights therein shall remain at all times with Tetcos. *
10* *
11* Author: Shashi Kant Suman *
12* *
13* ---------------------------------------------------------------------------------*/
14
15
16/************************************************************************************
17RFC 3561 Ad hoc On-Demand Distance Vector (AODV) Routing July 2003
18************************************************************************************/
19
20#ifndef _NETSIM_AODV_H_
21#define _NETSIM_AODV_H_
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#define AODV_ACTIVE_ROUTE_TIMEOUT 3000* MILLISECOND
27#define AODV_ALLOWED_HELLO_LOSS 2
28#define AODV_BLACKLIST_TIMEOUT AODV_RREQ_RETRIES * AODV_NET_TRAVERSAL_TIME
29#define AODV_DELETE_PERIOD K * max (AODV_ACTIVE_ROUTE_TIMEOUT, AODV_HELLO_INTERVAL)
30#define K 5
31#define AODV_HELLO_INTERVAL 1000* MILLISECOND
32#define AODV_LOCAL_ADD_TTL 2
33#define AODV_MAX_REPAIR_TTL 0.3 * AODV_NET_DIAMETER
34#define AODV_MIN_REPAIR_TTL //see note below
35#define AODV_MY_ROUTE_TIMEOUT (2 * AODV_ACTIVE_ROUTE_TIMEOUT)
36#define AODV_NET_DIAMETER 35
37#define AODV_NET_TRAVERSAL_TIME 2 * AODV_NODE_TRAVERSAL_TIME * AODV_NET_DIAMETER
38#define AODV_NEXT_HOP_WAIT AODV_NODE_TRAVERSAL_TIME + 10
39#define AODV_NODE_TRAVERSAL_TIME 40 * MILLISECOND
40#define AODV_PATH_DISCOVERY_TIME 2 * AODV_NET_TRAVERSAL_TIME
41#define AODV_RERR_RATELIMIT 10
42#define AODV_RING_TRAVERSAL_TIME(ttl) 2 * AODV_NODE_TRAVERSAL_TIME *(ttl + AODV_TIMEOUT_BUFFER)
43#define AODV_RREQ_RETRIES 2
44#define AODV_RREQ_RATELIMIT 10
45#define AODV_TIMEOUT_BUFFER 2
46#define AODV_TTL_START 1
47#define AODV_TTL_INCREMENT 2
48#define AODV_TTL_THRESHOLD 7
49
50 //Packet size
51#define AODV_RREQ_SIZE_IPV4 24 ///< AODV route request size in bytes
52#define AODV_RREQ_SIZE_IPV6 72
53#define AODV_RREQ_SIZE(dev) DEVICE_NWPROTOCOL(dev,1) == NW_PROTOCOL_IPV4 ? AODV_RREQ_SIZE_IPV4:AODV_RREQ_SIZE_IPV6
54#define AODV_RREP_SIZE_IPV4 20 ///< AODV route reply size in bytes
55#define AODV_RREP_SIZE_IPV6 56
56#define AODV_RREP_SIZE(dev) DEVICE_NWPROTOCOL(dev,1) == NW_PROTOCOL_IPV4 ? AODV_RREP_SIZE_IPV4:AODV_RREP_SIZE_IPV6
57#define AODV_RERR_SIZE_FIXED 4 ///< AODV route error size in bytes
58
59
60 //Typedef
62 typedef struct stru_AODV_Primitives AODV_PRIMITIVES;
64 typedef struct stru_AODV_FIFO AODV_FIFO;
70
71 //packet typedef
75 /** Enumeration for AODV control packets */
77 {
81 };
82 /** Enumeration for AODV sub events */
83 typedef enum
84 {
89
90 /**
91 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92 5.1. Route Request (RREQ) Message Format
93
94 0 1 2 3
95 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
96 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
97 | Type |J|R|G|D|U| Reserved | Hop Count |
98 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
99 | RREQ ID |
100 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
101 | Destination IP Address |
102 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
103 | Destination Sequence Number |
104 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
105 | Originator IP Address |
106 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
107 | Originator Sequence Number |
108 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
109 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
110 */
112 {
113 unsigned int Type:8; //1
114 char JRGDU[6]; /**<
115 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116 J Join flag; reserved for multicast.
117
118 R Repair flag; reserved for multicast.
119
120 G Gratuitous RREP flag; indicates whether a
121 gratuitous RREP should be unicast to the node
122 specified in the Destination IP Address field (see
123 sections 6.3, 6.6.3).
124
125 D Destination only flag; indicates only the
126 destination may respond to this RREQ (see
127 section 6.5).
128
129 U Unknown sequence number; indicates the destination
130 sequence number is unknown (see section 6.3).
131 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
132 */
133 unsigned int Reserved:11; ///< Sent as 0; ignored on reception.
134 unsigned int HopCount:8; /**<
135 The number of hops from the Originator IP Address
136 to the node handling the request.
137 */
138 unsigned int RREQID; /**<
139 A sequence number uniquely identifying the
140 particular RREQ when taken in conjunction with the
141 originating node's IP address.
142 */
143 NETSIM_IPAddress DestinationIPAddress;/**< The IP address of the destination for which a route is desired.*/
144 unsigned int DestinationSequenceNumber;/**<
145 The latest sequence number received in the past by the originator for any route towards the
146 destination.
147 */
148 NETSIM_IPAddress OriginatorIPAddress;/**< The IP address of the node which originated the Route Request.*/
149 unsigned int OriginatorSequenceNumber;/**<
150 The current sequence number to be used in the route
151 entry pointing towards the originator of the route
152 request.
153 */
155 };
156
157
158 /**
159 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160 5.2. Route Reply (RREP) Message Format
161
162 0 1 2 3
163 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
164 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
165 | Type |R|A| Reserved |Prefix Sz| Hop Count |
166 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
167 | Destination IP address |
168 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
169 | Destination Sequence Number |
170 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
171 | Originator IP address |
172 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
173 | Lifetime |
174 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
175
176 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177 */
179 {
180 unsigned int Type:8;//2
181 char RA[3]; /**<
182 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183 R Repair flag; used for multicast.
184
185 A Acknowledgment required; see sections 5.4 and 6.7.
186 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
187 */
188 unsigned int Reserved:9; ///< Sent as 0; ignored on reception.
189 unsigned int PrefixSz:5; /**<
190 If nonzero, the 5-bit Prefix Size specifies that the
191 indicated next hop may be used for any nodes with
192 the same routing prefix (as defined by the Prefix
193 Size) as the requested destination.
194 */
195 unsigned int HopCount:8; /**<
196 The number of hops from the Originator IP Address
197 to the Destination IP Address. For multicast route
198 requests this indicates the number of hops to the
199 multicast tree member sending the RREP.
200 */
201 NETSIM_IPAddress DestinationIPaddress;////< The IP address of the destination for which a route is supplied.
202 unsigned int DestinationSequenceNumber;///< The destination sequence number associated to the route.
203 NETSIM_IPAddress OriginatorIPaddress;///< The IP address of the node which originated the RREQ for which the route is supplied.
204 unsigned int Lifetime;///< The time in milliseconds for which nodes receiving the RREP consider the route to be valid.
205 NETSIM_IPAddress LastAddress; //NetSim-specific
206 };
207
208 /**
209 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
210
211 5.3. Route Error (RERR) Message Format
212
213 0 1 2 3
214 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
215 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
216 | Type |N| Reserved | DestCount |
217 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
218 | Unreachable Destination IP Address (1) |
219 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
220 | Unreachable Destination Sequence Number (1) |
221 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|
222 | Additional Unreachable Destination IP Addresses (if needed) |
223 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
224 |Additional Unreachable Destination Sequence Numbers (if needed)|
225 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
226
227 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
228 */
230 {
231 unsigned int Type:8;//3
232 char N;/**<
233 No delete flag; set when a node has performed a local
234 repair of a link, and upstream nodes should not delete
235 the route.
236 */
237 unsigned int Reserved:15; ///< Sent as 0; ignored on reception.
238 unsigned int DestCount:8;/**<
239 The number of unreachable destinations included in the
240 message; MUST be at least 1.
241 */
242
244 The IP address of the destination that has become
245 unreachable due to a link break.
246 */
247
249 The sequence number in the route table entry for
250 the destination listed in the previous Unreachable
251 Destination IP Address field.
252 */
253 };
254
255 /**
256 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
257 5.4. Route Reply Acknowledgment (RREP-ACK) Message Format
258
259 The Route Reply Acknowledgment (RREP-ACK) message MUST be sent in
260 response to a RREP message with the 'A' bit set (see section 5.2).
261 This is typically done when there is danger of unidirectional links
262 preventing the completion of a Route Discovery cycle (see section
263 6.8).
264
265 0 1
266 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
267 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
268 | Type | Reserved |
269 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
270
271 Type 4
272
273 Reserved Sent as 0; ignored on reception.
274
275 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
276 */
278 {
279 unsigned int Type:8;
280 unsigned int Reserved:8;
281 };
282
283
284 typedef enum
285 {
292 {
294 int count;
295 };
296 /**
297 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
298 AODV is a routing protocol, and it deals with route table management.
299 Route table information must be kept even for short-lived routes,
300 such as are created to temporarily store reverse paths towards nodes
301 originating RREQs. AODV uses the following fields with each route
302 table entry:
303
304 - Destination IP Address
305 - Destination Sequence Number
306 - Valid Destination Sequence Number flag
307 - Other state and routing flags (e.g., valid, invalid, repairable,
308 being repaired)
309 - Network Interface
310 - Hop Count (number of hops needed to reach destination)
311 - Next Hop
312 - List of Precursors (described in Section 6.2)
313 - Lifetime (expiration or deletion time of the route)
314 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
315 */
317 {
323 unsigned int HopCount;
326 double Lifetime;
327 struct element* ele;
328 };
329 /**
330 This is a buffer to which packets are added after if no route is present to the target.
331 */
333 {
334 NETSIM_IPAddress destination; ///< Destination - destination ip address.
335 NetSim_PACKET* packetList; ///< PacketList - List of packets added to the FIFO buffer.
336 double time;
337 struct element* ele; ///< ele - next buffer
338 };
339 ///Structure of RREQ Seen Table in which entry is made of the RREQ received
341 {
342 NETSIM_IPAddress OrginatingNode; ///< IP address of a node originating RREQ
343 unsigned int nRREQId; ///< RREQ identification no
344 double time;
345 struct element* ele; ///< Next AODV_RREQ_Seen_Table
346 };
347 ///Structure of RREQ sent Table in which entry of RREQ sent is made
349 {
350 NETSIM_IPAddress DestAddress; ///< Destination IP Address
351 int ttl; ///< Time to live
352 int times;
354 struct element* ele; ///< Next AODV_RREQ_Sent_Table
355 };
356 /// Stucture for AODV Metrics
358 {
359 unsigned int rreqSent;
360 unsigned int rreqForwarded;
361 unsigned int rrepSent;
362 unsigned int rrepForwarded;
363 unsigned int rerrSent;
364 unsigned int rerrForwarded;
365 unsigned int routeBreak;
366 unsigned int packetTransmitted;
367 unsigned int packetOrginated;
368 unsigned int packetReceived;
369 unsigned int packetDropped;
370 };
371 /**
372 This is the AODV DeviceVariable Structure which contains -
373 FIFO - a packet is added in FIFO buffer if the device does not have route to the target<br>
374 routeTable - this contains the next HOP ip of the routes to the target<br>
375 RREQ_SEEN_TABLE - this contains list differnet RREQ a device encounters.
376 */
378 {
379 unsigned int nSequenceNumber;
386 unsigned int nRerrCount;
389 };
390
391#define AODV_PACKET_PROCESSING() fn_NetSim_AODV_GeneralPacketProcessing(pstruEventDetails)
392#define AODV_CHECK_ROUTE_FOUND(destIP) fn_NetSim_AODV_CheckRouteFound(destIP,pstruEventDetails)
393#define AODV_ADD_TO_FIFO(packet,fifoBuffer,time) fn_NetSim_AODV_AddToFIFOBuffer(packet,fifoBuffer,time)
394#define AODV_GEN_RREQ() fn_NetSim_AODV_GenerateRREQ(pstruEventDetails)
395#define AODV_RETRY_RREQ() fn_NetSim_AODV_RetryRREQ(pstruEventDetails)
396#define AODV_PROCESS_RREQ() fn_NetSim_AODV_ProcessRREQ(pstruEventDetails)
397#define AODV_INSERT_ROUTE_TABLE(ip,seq,hopcount,nexthop,lifeTime) fn_NetSim_AODV_InsertInRouteTable(ip,seq,hopcount,nexthop,lifeTime,pstruEventDetails)
398#define AODV_INSERT_PRECURSOR(ip) fn_NetSim_AODV_InsertInPrecursorsList(ip,pstruEventDetails)
399#define AODV_FORWARD_RREQ() fn_NetSim_AODV_ForwardRREQ(pstruEventDetails)
400#define AODV_GENERATE_RREP() fn_NetSim_AODV_GenerateRREP(pstruEventDetails)
401#define AODV_TRANSMIT_FIFO(devVar) fn_NetSim_AODV_TransmitFIFOBuffer(devVar,pstruEventDetails)
402#define AODV_PROCESS_RREP() fn_NetSim_AODV_ProcessRREP(pstruEventDetails)
403#define AODV_FORWARD_RREP() fn_NetSim_AODV_ForwardRREP(pstruEventDetails)
404#define AODV_FIND_NEXT_HOP(devVar,dest) fn_NetSim_AODV_FindNextHop(devVar,dest,pstruEventDetails)
405#define AODV_GENERATE_RREP_BY_IN() fn_NetSim_AODV_GenerateRREPByIntermediate(pstruEventDetails)
406#define AODV_TRANSMIT_HELLO() fn_NetSim_AODV_TransmitHelloMessage(pstruEventDetails)
407#define AODV_UPDATE_ROUTE_TABLE(ip,lifetime) fn_NetSim_AODV_UpdateRouteTable(ip,lifetime,pstruEventDetails)
408#define AODV_ACTIVE_ROUTE_TIMEOUT_EVENT() fn_NetSim_AODV_ActiveRouteTimeout(pstruEventDetails)
409#define AODV_GENERATE_RERR(DevId,UnreachableIP) fn_NetSim_AODV_GenerateRERR(DevId,UnreachableIP,pstruEventDetails)
410#define AODV_PROCESS_RERR() fn_NetSim_AODV_ProcessRERR(pstruEventDetails)
411
412
413#define AODV_DEV_VAR(devId) ((AODV_DEVICE_VAR*)NETWORK->ppstruDeviceList[devId-1]->pstruNetworkLayer->RoutingVar)
414#define AODV_METRICS_VAR(devId) (AODV_DEV_VAR(devId)->aodvMetrics)
415#define FIFO_ALLOC() (AODV_FIFO*)list_alloc(sizeof(AODV_FIFO),offsetof(AODV_FIFO,ele))
416#define RREQSEENTABLE_ALLOC() (AODV_RREQ_SEEN_TABLE*)list_alloc(sizeof(AODV_RREQ_SEEN_TABLE),offsetof(AODV_RREQ_SEEN_TABLE,ele))
417#define RREQSENTTABLE_ALLOC() (AODV_RREQ_SENT_TABLE*)list_alloc(sizeof(AODV_RREQ_SENT_TABLE),offsetof(AODV_RREQ_SENT_TABLE,ele))
418#define ROUTETABLE_ALLOC() (AODV_ROUTETABLE*)list_alloc(sizeof(AODV_ROUTETABLE),offsetof(AODV_ROUTETABLE,ele))
419
425
426 //Function prototype
431 NETSIM_ID dest,
432 NETSIM_ID recv,
433 double dTime,
436 unsigned int seqNumber,
437 unsigned int hopCount,
438 NETSIM_IPAddress nextHop,
439 double lifeTime,
447 NETSIM_IPAddress dest,
451
454
456 AODV_FIFO** fifoBuffer,
457 double time);
458
460
462
464
466 unsigned int seqNumber,
467 unsigned int hopCount,
468 NETSIM_IPAddress nextHop,
469 double lifeTime,
471
474
476
478
482 NETSIM_IPAddress dest,
484
486
488
490
492 double lifetime,
494
496
498 NETSIM_IPAddress UnreachableIP,
501
502
503#ifdef __cplusplus
504}
505#endif
506#endif
int fn_NetSim_AODV_GenerateRREP(NetSim_EVENTDETAILS *pstruEventDetails)
Definition: RREP.c:22
NETSIM_ID aodv_get_curr_if()
int fn_NetSim_AODV_UpdateRouteTable(NETSIM_IPAddress ip, double lifetime, NetSim_EVENTDETAILS *pstruEventDetails)
Definition: RouteTable.c:147
void set_aodv_curr()
unsigned int fnFindSequenceNumber(AODV_DEVICE_VAR *devVar, NETSIM_IPAddress ip)
int fn_NetSim_AODV_TransmitFIFOBuffer(AODV_DEVICE_VAR *devVar, NetSim_EVENTDETAILS *pstruEventDetails)
Definition: FIFOBuffer.c:81
NetSim_PACKET * fn_NetSim_AODV_GenerateCtrlPacket(NETSIM_ID src, NETSIM_ID dest, NETSIM_ID recv, double dTime, AODV_CONTROL_PACKET type)
int fn_NetSim_AODV_ProcessRERR(NetSim_EVENTDETAILS *pstruEventDetails)
enum_AODV_Ctrl_Packet
Definition: AODV.h:77
@ AODVctrlPacket_RERR
Definition: AODV.h:80
@ AODVctrlPacket_RREP
Definition: AODV.h:79
@ AODVctrlPacket_RREQ
Definition: AODV.h:78
AODV_ROUTETABLE * fnFindRouteTable(AODV_ROUTETABLE *table, NETSIM_IPAddress dest)
Definition: RouteTable.c:132
AODV_SUB_EVENT
Definition: AODV.h:84
@ AODVsubevent_RREQ_TIMEOUT
Definition: AODV.h:85
@ AODVsubevent_TRANSMIT_HELLO
Definition: AODV.h:86
@ AODVsubevent_ACTIVE_ROUTE_TIMEOUT
Definition: AODV.h:87
int fn_NetSim_AODV_ForwardRREQ(NetSim_EVENTDETAILS *pstruEventDetails)
Definition: RREQ.c:358
int fn_NetSim_AODV_ReceiveHelloMessage(NetSim_EVENTDETAILS *pstruEventDetails)
bool isAodvConfigured(NETSIM_ID d, NETSIM_ID in)
bool fn_NetSim_AODV_AddToFIFOBuffer(NetSim_PACKET *packet, AODV_FIFO **fifoBuffer, double time)
Definition: FIFOBuffer.c:21
int fn_NetSim_AODV_TransmitHelloMessage(NetSim_EVENTDETAILS *pstruEventDetails)
Definition: HelloMessage.c:21
NETSIM_IPAddress fn_NetSim_AODV_FindNextHop(AODV_DEVICE_VAR *devVar, NETSIM_IPAddress dest, NetSim_EVENTDETAILS *pstruEventDetails)
Definition: RouteTable.c:115
int fn_NetSim_AODV_RetryRREQ(NetSim_EVENTDETAILS *pstruEventDetails)
Definition: RREQ.c:179
NETSIM_IPAddress aodv_get_curr_ip()
int fn_NetSim_AODV_ProcessRREP(NetSim_EVENTDETAILS *pstruEventDetails)
Definition: RREP.c:64
AODV_RoutingFlag
Definition: AODV.h:285
@ AODV_RoutingFlag_InValid
Definition: AODV.h:287
@ AODV_RoutingFlag_Repairable
Definition: AODV.h:288
@ AODV_RoutingFlag_beingRepaired
Definition: AODV.h:289
@ AODV_RoutingFlag_Valid
Definition: AODV.h:286
int fn_NetSim_AODV_InsertInPrecursorsList(NETSIM_IPAddress ip, NetSim_EVENTDETAILS *pstruEventDetails)
Definition: RouteTable.c:90
struct stru_AODV_Primitives AODV_PRIMITIVES
Definition: AODV.h:62
enum enum_AODV_Ctrl_Packet AODV_CONTROL_PACKET
Definition: AODV.h:61
int fn_NetSim_AODV_GeneralPacketProcessing(NetSim_EVENTDETAILS *pstruEventDetails)
int fn_NetSim_AODV_GenerateRREPByIntermediate(NetSim_EVENTDETAILS *pstruEventDetails)
Definition: RREP.c:140
NETSIM_IPAddress aodv_get_dev_ip(NETSIM_ID d)
int fn_NetSim_AODV_GenerateRERR(NETSIM_ID nDeviceId, NETSIM_IPAddress UnreachableIP, NetSim_EVENTDETAILS *pstruEventDetails)
int fn_NetSim_AODV_InsertInRouteTable(NETSIM_IPAddress ip, unsigned int seqNumber, unsigned int hopCount, NETSIM_IPAddress nextHop, double lifeTime, NetSim_EVENTDETAILS *pstruEventDetails)
Definition: RouteTable.c:22
int fn_NetSim_AODV_ForwardRREP(NetSim_EVENTDETAILS *pstruEventDetails)
Definition: RREP.c:109
NetSim_PACKET * fn_NetSim_AODV_GenerateRREQ(NetSim_EVENTDETAILS *pstruEventDetails)
Definition: RREQ.c:36
int fn_NetSim_AODV_ProcessRREQ(NetSim_EVENTDETAILS *pstruEventDetails)
Definition: RREQ.c:285
int fn_NetSim_AODV_ActiveRouteTimeout(NetSim_EVENTDETAILS *pstruEventDetails)
Definition: RouteTable.c:165
bool fn_NetSim_AODV_CheckRouteFound(NETSIM_IPAddress ip, NetSim_EVENTDETAILS *pstruEventDetails)
int fnEmptyFIFOBuffer(AODV_DEVICE_VAR *devVar, NETSIM_IPAddress dest)
Definition: FIFOBuffer.c:54
unsigned int NETSIM_ID
Definition: Animation.h:45
@ NW_PROTOCOL_AODV
Definition: Stack.h:197
EXPORTED struct stru_NetSim_EventDetails * pstruEventDetails
Definition: Stack.h:837
Definition: List.h:43
AODV_RREQ_SEEN_TABLE * rreqSeenTable
Definition: AODV.h:382
AODV_METRICS aodvMetrics
Definition: AODV.h:388
AODV_FIFO * fifo
Definition: AODV.h:380
AODV_RREQ_SENT_TABLE * rreqSentTable
Definition: AODV.h:383
unsigned int nSequenceNumber
Definition: AODV.h:379
AODV_PRECURSORS_LIST * precursorsList
Definition: AODV.h:384
unsigned int nRerrCount
Definition: AODV.h:386
AODV_ROUTETABLE * routeTable
Definition: AODV.h:381
double dLastBroadcastTime
Definition: AODV.h:385
NetSim_PACKET * packetList
PacketList - List of packets added to the FIFO buffer.
Definition: AODV.h:335
NETSIM_IPAddress destination
Destination - destination ip address.
Definition: AODV.h:334
struct element * ele
ele - next buffer
Definition: AODV.h:337
double time
Definition: AODV.h:336
Stucture for AODV Metrics.
Definition: AODV.h:358
unsigned int rreqSent
Definition: AODV.h:359
unsigned int rerrSent
Definition: AODV.h:363
unsigned int routeBreak
Definition: AODV.h:365
unsigned int rrepSent
Definition: AODV.h:361
unsigned int packetDropped
Definition: AODV.h:369
unsigned int rerrForwarded
Definition: AODV.h:364
unsigned int rrepForwarded
Definition: AODV.h:362
unsigned int packetTransmitted
Definition: AODV.h:366
unsigned int packetReceived
Definition: AODV.h:368
unsigned int rreqForwarded
Definition: AODV.h:360
unsigned int packetOrginated
Definition: AODV.h:367
Structure of RREQ Seen Table in which entry is made of the RREQ received.
Definition: AODV.h:341
struct element * ele
Next AODV_RREQ_Seen_Table
Definition: AODV.h:345
unsigned int nRREQId
RREQ identification no.
Definition: AODV.h:343
NETSIM_IPAddress OrginatingNode
IP address of a node originating RREQ
Definition: AODV.h:342
Structure of RREQ sent Table in which entry of RREQ sent is made.
Definition: AODV.h:349
NETSIM_IPAddress DestAddress
Destination IP Address.
Definition: AODV.h:350
struct element * ele
Next AODV_RREQ_Sent_Table.
Definition: AODV.h:354
int ttl
Time to live.
Definition: AODV.h:351
NETSIM_IPAddress * list
Definition: AODV.h:293
unsigned int * UnreachableDestinationSequenceNumber
Definition: AODV.h:248
unsigned int DestCount
Definition: AODV.h:238
unsigned int Reserved
Sent as 0; ignored on reception.
Definition: AODV.h:237
NETSIM_IPAddress * UnreachableDestinationIPAddress
Definition: AODV.h:243
unsigned int Type
Definition: AODV.h:231
unsigned int Type
Definition: AODV.h:279
unsigned int Reserved
Definition: AODV.h:280
unsigned int HopCount
Definition: AODV.h:195
NETSIM_IPAddress OriginatorIPaddress
The IP address of the node which originated the RREQ for which the route is supplied.
Definition: AODV.h:203
unsigned int Reserved
Sent as 0; ignored on reception.
Definition: AODV.h:188
unsigned int PrefixSz
Definition: AODV.h:189
unsigned int DestinationSequenceNumber
The destination sequence number associated to the route.
Definition: AODV.h:202
unsigned int Type
Definition: AODV.h:180
unsigned int Lifetime
The time in milliseconds for which nodes receiving the RREP consider the route to be valid.
Definition: AODV.h:204
NETSIM_IPAddress LastAddress
Definition: AODV.h:205
NETSIM_IPAddress DestinationIPaddress
Definition: AODV.h:201
unsigned int HopCount
Definition: AODV.h:134
NETSIM_IPAddress DestinationIPAddress
Definition: AODV.h:143
NETSIM_IPAddress OriginatorIPAddress
Definition: AODV.h:148
unsigned int Reserved
Sent as 0; ignored on reception.
Definition: AODV.h:133
unsigned int RREQID
Definition: AODV.h:138
unsigned int OriginatorSequenceNumber
Definition: AODV.h:149
unsigned int DestinationSequenceNumber
Definition: AODV.h:144
unsigned int Type
Definition: AODV.h:113
NETSIM_IPAddress LastAddress
Definition: AODV.h:154
struct element * ele
Definition: AODV.h:327
bool ValidDestinationSequenceNumberflag
Definition: AODV.h:320
NETSIM_ID NetworkInterface
Definition: AODV.h:322
AODV_RoutingFlag routingFlags
Definition: AODV.h:321
unsigned int HopCount
Definition: AODV.h:323
NETSIM_IPAddress NextHop
Definition: AODV.h:324
NETSIM_IPAddress DestinationIPAddress
Definition: AODV.h:318
unsigned int DestinationSequenceNumber
Definition: AODV.h:319
AODV_PRECURSORS_LIST * ListofPrecursors
Definition: AODV.h:325