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) 2010 Hemanth Narra, Yufei Cheng | 3 * Copyright (c) 2010 Hemanth Narra, Yufei Cheng |
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 19 matching lines...) Expand all Loading... |
30 * US Department of Defense (DoD), and ITTC at The University of Kansas. | 30 * US Department of Defense (DoD), and ITTC at The University of Kansas. |
31 */ | 31 */ |
32 | 32 |
33 #ifndef DSDV_ROUTING_PROTOCOL_H | 33 #ifndef DSDV_ROUTING_PROTOCOL_H |
34 #define DSDV_ROUTING_PROTOCOL_H | 34 #define DSDV_ROUTING_PROTOCOL_H |
35 | 35 |
36 #include "dsdv-rtable.h" | 36 #include "dsdv-rtable.h" |
37 #include "dsdv-packet-queue.h" | 37 #include "dsdv-packet-queue.h" |
38 #include "dsdv-packet.h" | 38 #include "dsdv-packet.h" |
39 #include "ns3/node.h" | 39 #include "ns3/node.h" |
| 40 #include "ns3/random-variable-stream.h" |
40 #include "ns3/ipv4-routing-protocol.h" | 41 #include "ns3/ipv4-routing-protocol.h" |
41 #include "ns3/ipv4-interface.h" | 42 #include "ns3/ipv4-interface.h" |
42 #include "ns3/ipv4-l3-protocol.h" | 43 #include "ns3/ipv4-l3-protocol.h" |
43 #include "ns3/output-stream-wrapper.h" | 44 #include "ns3/output-stream-wrapper.h" |
44 | 45 |
45 namespace ns3 { | 46 namespace ns3 { |
46 namespace dsdv { | 47 namespace dsdv { |
47 | 48 |
48 /** | 49 /** |
49 * \ingroup dsdv | 50 * \ingroup dsdv |
(...skipping 28 matching lines...) Expand all Loading... |
78 ///\name Methods to handle protocol parameters | 79 ///\name Methods to handle protocol parameters |
79 // \{ | 80 // \{ |
80 void SetEnableBufferFlag (bool f); | 81 void SetEnableBufferFlag (bool f); |
81 bool GetEnableBufferFlag () const; | 82 bool GetEnableBufferFlag () const; |
82 void SetWSTFlag (bool f); | 83 void SetWSTFlag (bool f); |
83 bool GetWSTFlag () const; | 84 bool GetWSTFlag () const; |
84 void SetEnableRAFlag (bool f); | 85 void SetEnableRAFlag (bool f); |
85 bool GetEnableRAFlag () const; | 86 bool GetEnableRAFlag () const; |
86 // \} | 87 // \} |
87 | 88 |
| 89 /** |
| 90 * Assign a fixed random variable stream number to the random variables |
| 91 * used by this model. Return the number of streams (possibly zero) that |
| 92 * have been assigned. |
| 93 * |
| 94 * \param stream first stream index to use |
| 95 * \return the number of stream indices assigned by this model |
| 96 */ |
| 97 int64_t AssignStreams (int64_t stream); |
| 98 |
88 private: | 99 private: |
89 ///\name Protocol parameters. | 100 ///\name Protocol parameters. |
90 // \{ | 101 // \{ |
91 /// Holdtimes is the multiplicative factor of PeriodicUpdateInterval for which
the node waits since the last update | 102 /// Holdtimes is the multiplicative factor of PeriodicUpdateInterval for which
the node waits since the last update |
92 /// before flushing a route from the routing table. If PeriodicUpdateInterval
is 8s and Holdtimes is 3, the node | 103 /// before flushing a route from the routing table. If PeriodicUpdateInterval
is 8s and Holdtimes is 3, the node |
93 /// waits for 24s since the last update to flush this route from its routing t
able. | 104 /// waits for 24s since the last update to flush this route from its routing t
able. |
94 uint32_t Holdtimes; | 105 uint32_t Holdtimes; |
95 /// PeriodicUpdateInterval specifies the periodic time interval between which
the a node broadcasts | 106 /// PeriodicUpdateInterval specifies the periodic time interval between which
the a node broadcasts |
96 /// its entire routing table. | 107 /// its entire routing table. |
97 Time m_periodicUpdateInterval; | 108 Time m_periodicUpdateInterval; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 SendPeriodicUpdate (); | 192 SendPeriodicUpdate (); |
182 void | 193 void |
183 MergeTriggerPeriodicUpdates (); | 194 MergeTriggerPeriodicUpdates (); |
184 /// Notify that packet is dropped for some reason | 195 /// Notify that packet is dropped for some reason |
185 void | 196 void |
186 Drop (Ptr<const Packet>, const Ipv4Header &, Socket::SocketErrno); | 197 Drop (Ptr<const Packet>, const Ipv4Header &, Socket::SocketErrno); |
187 /// Timer to trigger periodic updates from a node | 198 /// Timer to trigger periodic updates from a node |
188 Timer m_periodicUpdateTimer; | 199 Timer m_periodicUpdateTimer; |
189 /// Timer used by the trigger updates in case of Weighted Settling Time is use
d | 200 /// Timer used by the trigger updates in case of Weighted Settling Time is use
d |
190 Timer m_triggeredExpireTimer; | 201 Timer m_triggeredExpireTimer; |
| 202 |
| 203 /// Provides uniform random variables. |
| 204 Ptr<UniformRandomVariable> m_uniformRandomVariable;·· |
191 }; | 205 }; |
192 | 206 |
193 } | 207 } |
194 } | 208 } |
195 | 209 |
196 #endif /* DSDV_ROUTING_PROTOCOL_H */ | 210 #endif /* DSDV_ROUTING_PROTOCOL_H */ |
OLD | NEW |