OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2009 IITP RAS | 3 * Copyright (c) 2009 IITP RAS |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 16 matching lines...) Expand all Loading... |
27 */ | 27 */ |
28 #ifndef AODVROUTINGPROTOCOL_H | 28 #ifndef AODVROUTINGPROTOCOL_H |
29 #define AODVROUTINGPROTOCOL_H | 29 #define AODVROUTINGPROTOCOL_H |
30 | 30 |
31 #include "aodv-rtable.h" | 31 #include "aodv-rtable.h" |
32 #include "aodv-rqueue.h" | 32 #include "aodv-rqueue.h" |
33 #include "aodv-packet.h" | 33 #include "aodv-packet.h" |
34 #include "aodv-neighbor.h" | 34 #include "aodv-neighbor.h" |
35 #include "aodv-dpd.h" | 35 #include "aodv-dpd.h" |
36 #include "ns3/node.h" | 36 #include "ns3/node.h" |
| 37 #include "ns3/random-variable-stream.h" |
37 #include "ns3/output-stream-wrapper.h" | 38 #include "ns3/output-stream-wrapper.h" |
38 #include "ns3/ipv4-routing-protocol.h" | 39 #include "ns3/ipv4-routing-protocol.h" |
39 #include "ns3/ipv4-interface.h" | 40 #include "ns3/ipv4-interface.h" |
40 #include "ns3/ipv4-l3-protocol.h" | 41 #include "ns3/ipv4-l3-protocol.h" |
41 #include <map> | 42 #include <map> |
42 | 43 |
43 namespace ns3 | 44 namespace ns3 |
44 { | 45 { |
45 namespace aodv | 46 namespace aodv |
46 { | 47 { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 void SetMaxQueueLen (uint32_t len); | 83 void SetMaxQueueLen (uint32_t len); |
83 bool GetDesinationOnlyFlag () const { return DestinationOnly; } | 84 bool GetDesinationOnlyFlag () const { return DestinationOnly; } |
84 void SetDesinationOnlyFlag (bool f) { DestinationOnly = f; } | 85 void SetDesinationOnlyFlag (bool f) { DestinationOnly = f; } |
85 bool GetGratuitousReplyFlag () const { return GratuitousReply; } | 86 bool GetGratuitousReplyFlag () const { return GratuitousReply; } |
86 void SetGratuitousReplyFlag (bool f) { GratuitousReply = f; } | 87 void SetGratuitousReplyFlag (bool f) { GratuitousReply = f; } |
87 void SetHelloEnable (bool f) { EnableHello = f; } | 88 void SetHelloEnable (bool f) { EnableHello = f; } |
88 bool GetHelloEnable () const { return EnableHello; } | 89 bool GetHelloEnable () const { return EnableHello; } |
89 void SetBroadcastEnable (bool f) { EnableBroadcast = f; } | 90 void SetBroadcastEnable (bool f) { EnableBroadcast = f; } |
90 bool GetBroadcastEnable () const { return EnableBroadcast; } | 91 bool GetBroadcastEnable () const { return EnableBroadcast; } |
91 //\} | 92 //\} |
| 93 |
| 94 /** |
| 95 * Assign a fixed random variable stream number to the random variables |
| 96 * used by this model. Return the number of streams (possibly zero) that |
| 97 * have been assigned. |
| 98 * |
| 99 * \param stream first stream index to use |
| 100 * \return the number of stream indices assigned by this model |
| 101 */ |
| 102 int64_t AssignStreams (int64_t stream); |
| 103 |
92 private: | 104 private: |
93 ///\name Protocol parameters. | 105 ///\name Protocol parameters. |
94 //\{ | 106 //\{ |
95 uint32_t RreqRetries; ///< Maximum number of retransmissions of RR
EQ with TTL = NetDiameter to discover a route | 107 uint32_t RreqRetries; ///< Maximum number of retransmissions of RR
EQ with TTL = NetDiameter to discover a route |
96 uint16_t RreqRateLimit; ///< Maximum number of RREQ per second. | 108 uint16_t RreqRateLimit; ///< Maximum number of RREQ per second. |
97 uint16_t RerrRateLimit; ///< Maximum number of REER per second. | 109 uint16_t RerrRateLimit; ///< Maximum number of REER per second. |
98 Time ActiveRouteTimeout; ///< Period of time during which the route i
s considered to be valid. | 110 Time ActiveRouteTimeout; ///< Period of time during which the route i
s considered to be valid. |
99 uint32_t NetDiameter; ///< Net diameter measures the maximum possi
ble number of hops between two nodes in the network | 111 uint32_t NetDiameter; ///< Net diameter measures the maximum possi
ble number of hops between two nodes in the network |
100 /** | 112 /** |
101 * NodeTraversalTime is a conservative estimate of the average one hop traver
sal time for packets | 113 * NodeTraversalTime is a conservative estimate of the average one hop traver
sal time for packets |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 /// RERR rate limit timer | 259 /// RERR rate limit timer |
248 Timer m_rerrRateLimitTimer; | 260 Timer m_rerrRateLimitTimer; |
249 /// Reset RERR count and schedule RERR rate limit timer with delay 1 sec. | 261 /// Reset RERR count and schedule RERR rate limit timer with delay 1 sec. |
250 void RerrRateLimitTimerExpire (); | 262 void RerrRateLimitTimerExpire (); |
251 /// Map IP address + RREQ timer. | 263 /// Map IP address + RREQ timer. |
252 std::map<Ipv4Address, Timer> m_addressReqTimer; | 264 std::map<Ipv4Address, Timer> m_addressReqTimer; |
253 /// Handle route discovery process | 265 /// Handle route discovery process |
254 void RouteRequestTimerExpire (Ipv4Address dst); | 266 void RouteRequestTimerExpire (Ipv4Address dst); |
255 /// Mark link to neighbor node as unidirectional for blacklistTimeout | 267 /// Mark link to neighbor node as unidirectional for blacklistTimeout |
256 void AckTimerExpire (Ipv4Address neighbor, Time blacklistTimeout); | 268 void AckTimerExpire (Ipv4Address neighbor, Time blacklistTimeout); |
| 269 |
| 270 /// Provides uniform random variables. |
| 271 Ptr<UniformRandomVariable> m_uniformRandomVariable;·· |
257 }; | 272 }; |
258 | 273 |
259 } | 274 } |
260 } | 275 } |
261 #endif /* AODVROUTINGPROTOCOL_H */ | 276 #endif /* AODVROUTINGPROTOCOL_H */ |
OLD | NEW |