A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
dsr-options.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Yufei Cheng
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Yufei Cheng <yfcheng@ittc.ku.edu>
7 *
8 * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
9 * ResiliNets Research Group https://resilinets.org/
10 * Information and Telecommunication Technology Center (ITTC)
11 * and Department of Electrical Engineering and Computer Science
12 * The University of Kansas Lawrence, KS USA.
13 *
14 * Work supported in part by NSF FIND (Future Internet Design) Program
15 * under grant CNS-0626918 (Postmodern Internet Architecture),
16 * NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimentation on GENI),
17 * US Department of Defense (DoD), and ITTC at The University of Kansas.
18 */
19
20#ifndef DSR_OPTION_H
21#define DSR_OPTION_H
22
24#include "dsr-maintain-buff.h"
25#include "dsr-option-header.h"
26#include "dsr-rcache.h"
27#include "dsr-routing.h"
28#include "dsr-rsendbuff.h"
29
30#include "ns3/buffer.h"
31#include "ns3/callback.h"
32#include "ns3/ipv4-address.h"
33#include "ns3/ipv4-header.h"
34#include "ns3/ipv4-interface.h"
35#include "ns3/ipv4-route.h"
36#include "ns3/ipv4.h"
37#include "ns3/node.h"
38#include "ns3/object.h"
39#include "ns3/output-stream-wrapper.h"
40#include "ns3/packet.h"
41#include "ns3/ptr.h"
42#include "ns3/timer.h"
43#include "ns3/traced-callback.h"
44#include "ns3/udp-l4-protocol.h"
45
46#include <list>
47#include <map>
48
49namespace ns3
50{
51
52class Packet;
53class NetDevice;
54class Node;
55class Ipv4Address;
56class Ipv4Interface;
57class Ipv4Route;
58class Ipv4;
59class Time;
60
61namespace dsr
62{
63
64class DsrOptions : public Object
65{
66 public:
67 /**
68 * @brief Get the type identificator.
69 * @return type identificator
70 */
71 static TypeId GetTypeId();
72 /**
73 * @brief Constructor.
74 */
75 DsrOptions();
76 /**
77 * @brief Destructor.
78 */
79 ~DsrOptions() override;
80 /**
81 * @brief Get the option number.
82 * @return option number
83 */
84 virtual uint8_t GetOptionNumber() const = 0;
85 /**
86 * @brief Set the node.
87 * @param node the node to set
88 */
89 void SetNode(Ptr<Node> node);
90 /**
91 * @brief Get the node.
92 * @return the node
93 */
94 Ptr<Node> GetNode() const;
95 /**
96 * @brief Search for the ipv4 address in the node list.
97 *
98 * @param ipv4Address IPv4 address to search for
99 * @param destAddress IPv4 address in the list that we begin the search
100 * @param nodeList List of IPv4 addresses
101 * @return true if contain ip address
102 */
103 bool ContainAddressAfter(Ipv4Address ipv4Address,
104 Ipv4Address destAddress,
105 std::vector<Ipv4Address>& nodeList);
106 /**
107 * @brief Cut the route from ipv4Address to the end of the route vector
108 *
109 * @param ipv4Address the address to begin cutting
110 * @param nodeList List of IPv4 addresses
111 * @return the vector after the route cut
112 */
113 std::vector<Ipv4Address> CutRoute(Ipv4Address ipv4Address, std::vector<Ipv4Address>& nodeList);
114 /**
115 * @brief Set the route to use for data packets,
116 * used by the option headers when sending data/control packets
117 *
118 * @param nextHop IPv4 address of the next hop
119 * @param srcAddress IPv4 address of the source
120 * @return the route
121 */
122 virtual Ptr<Ipv4Route> SetRoute(Ipv4Address nextHop, Ipv4Address srcAddress);
123 /**
124 * @brief Reverse the routes.
125 *
126 * @param vec List of IPv4 addresses
127 * @return true if successfully reversed
128 */
129 bool ReverseRoutes(std::vector<Ipv4Address>& vec);
130 /**
131 * @brief Search for the next hop in the route
132 *
133 * @param ipv4Address the IPv4 address of the node we are looking for its next hop address
134 * @param vec List of IPv4 addresses
135 * @return the next hop address if found
136 */
137 Ipv4Address SearchNextHop(Ipv4Address ipv4Address, std::vector<Ipv4Address>& vec);
138 /**
139 * @brief Reverse search for the next hop in the route
140 *
141 * @param ipv4Address the IPv4 address of the node we are looking for its next hop address
142 * @param vec List of IPv4 addresses
143 * @return the previous next hop address if found
144 */
145 Ipv4Address ReverseSearchNextHop(Ipv4Address ipv4Address, std::vector<Ipv4Address>& vec);
146 /**
147 * @brief Reverse search for the next two hop in the route
148 *
149 * @param ipv4Address the IPv4 address of the node we are looking for its next two hop address
150 * @param vec List of IPv4 addresses
151 * @return the previous next two hop address if found
152 */
153 Ipv4Address ReverseSearchNextTwoHop(Ipv4Address ipv4Address, std::vector<Ipv4Address>& vec);
154 /**
155 * @brief Print out the elements in the route vector
156 * @param vec The route vector to print.
157 */
158 void PrintVector(std::vector<Ipv4Address>& vec);
159 /**
160 * @brief Check if the two vectors contain duplicate or not
161 *
162 * @param vec the first list of IPv4 addresses
163 * @param vec2 the second list of IPv4 addresses
164 * @return true if contains duplicate
165 */
166 bool IfDuplicates(std::vector<Ipv4Address>& vec, std::vector<Ipv4Address>& vec2);
167 /**
168 * @brief Check if the route already contains the node ip address
169 *
170 * @param ipv4Address the IPv4 address that we are looking for
171 * @param vec List of IPv4 addresses
172 * @return true if it already exists
173 */
174 bool CheckDuplicates(Ipv4Address ipv4Address, std::vector<Ipv4Address>& vec);
175 /**
176 * @brief Remove the duplicates from the route
177 *
178 * @param [in,out] vec List of IPv4 addresses to clean
179 */
180 void RemoveDuplicates(std::vector<Ipv4Address>& vec);
181 /**
182 * @brief Schedule the intermediate node route request broadcast
183 * @param packet the original packet
184 * @param nodeList The list of IPv4 addresses
185 * @param source address
186 * @param destination address
187 */
189 std::vector<Ipv4Address>& nodeList,
190 Ipv4Address& source,
191 Ipv4Address& destination);
192 /**
193 * @brief Get the node id with Ipv4Address
194 *
195 * @param address IPv4 address to look for ID
196 * @return the id of the node
197 */
199 /**
200 * @brief Get the node object with Ipv4Address
201 *
202 * @param ipv4Address IPv4 address of the node
203 * @return the object of the node
204 */
206 /**
207 * @brief Process method
208 *
209 * Called from DsrRouting::Receive.
210 * @param packet the packet
211 * @param dsrP the clean packet with payload
212 * @param ipv4Address the IPv4 address
213 * @param source IPv4 address of the source
214 * @param ipv4Header the IPv4 header of packet received
215 * @param protocol the protocol number of the up layer
216 * @param isPromisc if the packet must be dropped
217 * @param promiscSource IPv4 address
218 * @return the processed size
219 */
220 virtual uint8_t Process(Ptr<Packet> packet,
221 Ptr<Packet> dsrP,
222 Ipv4Address ipv4Address,
223 Ipv4Address source,
224 const Ipv4Header& ipv4Header,
225 uint8_t protocol,
226 bool& isPromisc,
227 Ipv4Address promiscSource) = 0;
228
229 protected:
230 /**
231 * @brief Drop trace callback.
232 */
234 /**
235 * @brief The broadcast IP address.
236 */
238 /**
239 * @brief The route request table.
240 */
242 /**
243 * @brief The route cache table.
244 */
246 /**
247 * @brief The ipv4 route.
248 */
250 /**
251 * @brief The ipv4.
252 */
254 /**
255 * @brief The vector of Ipv4 address.
256 */
257 std::vector<Ipv4Address> m_ipv4Address;
258 /**
259 * @brief The vector of final Ipv4 address.
260 */
261 std::vector<Ipv4Address> m_finalRoute;
262 /**
263 * @brief The active route timeout value.
264 */
266 /**
267 * The receive trace back, only triggered when final destination receive data packet
268 */
270
271 private:
272 Ptr<Node> m_node; ///< the node
273};
274
275/**
276 * @class DsrOptionPad1
277 * @brief Dsr Option Pad1
278 */
280{
281 public:
282 /**
283 * @brief Pad1 option number.
284 */
285 static const uint8_t OPT_NUMBER = 224;
286
287 /**
288 * @brief Get the type ID.
289 * @return the object TypeId
290 */
291 static TypeId GetTypeId();
292
294 ~DsrOptionPad1() override;
295
296 uint8_t GetOptionNumber() const override;
297 uint8_t Process(Ptr<Packet> packet,
298 Ptr<Packet> dsrP,
299 Ipv4Address ipv4Address,
300 Ipv4Address source,
301 const Ipv4Header& ipv4Header,
302 uint8_t protocol,
303 bool& isPromisc,
304 Ipv4Address promiscSource) override;
305};
306
307/**
308 * @class DsrOptionPadn
309 * @brief IPv4 Option Padn
310 */
312{
313 public:
314 /**
315 * @brief PadN option number.
316 */
317 static const uint8_t OPT_NUMBER = 0;
318
319 /**
320 * @brief Get the type ID.
321 * @return the object TypeId
322 */
323 static TypeId GetTypeId();
324
326 ~DsrOptionPadn() override;
327
328 uint8_t GetOptionNumber() const override;
329 uint8_t Process(Ptr<Packet> packet,
330 Ptr<Packet> dsrP,
331 Ipv4Address ipv4Address,
332 Ipv4Address source,
333 const Ipv4Header& ipv4Header,
334 uint8_t protocol,
335 bool& isPromisc,
336 Ipv4Address promiscSource) override;
337};
338
339/**
340 * @class DsrOptionRreq
341 * @brief Dsr Option Rreq
342 */
344{
345 public:
346 /**
347 * @brief Rreq option number.
348 */
349 static const uint8_t OPT_NUMBER = 1;
350
351 /**
352 * @brief Get the type ID.
353 * @return the object TypeId
354 */
355 static TypeId GetTypeId();
356 /**
357 * @brief Get the instance type ID.
358 * @return instance type ID
359 */
360 TypeId GetInstanceTypeId() const override;
361 /**
362 * @brief Constructor.
363 */
365 /**
366 * @brief Destructor.
367 */
368 ~DsrOptionRreq() override;
369
370 uint8_t GetOptionNumber() const override;
371 uint8_t Process(Ptr<Packet> packet,
372 Ptr<Packet> dsrP,
373 Ipv4Address ipv4Address,
374 Ipv4Address source,
375 const Ipv4Header& ipv4Header,
376 uint8_t protocol,
377 bool& isPromisc,
378 Ipv4Address promiscSource) override;
379
380 private:
381 /**
382 * @brief The route cache.
383 */
385 /**
386 * @brief The ipv4.
387 */
389};
390
391/**
392 * @class DsrOptionRrep
393 * @brief Dsr Option Route Reply
394 */
396{
397 public:
398 /**
399 * @brief Router alert option number.
400 */
401 static const uint8_t OPT_NUMBER = 2;
402
403 /**
404 * @brief Get the type ID.
405 * @return the object TypeId
406 */
407 static TypeId GetTypeId();
408 /**
409 * @brief Get the instance type ID.
410 * @return instance type ID
411 */
412 TypeId GetInstanceTypeId() const override;
413
415 ~DsrOptionRrep() override;
416
417 uint8_t GetOptionNumber() const override;
418 uint8_t Process(Ptr<Packet> packet,
419 Ptr<Packet> dsrP,
420 Ipv4Address ipv4Address,
421 Ipv4Address source,
422 const Ipv4Header& ipv4Header,
423 uint8_t protocol,
424 bool& isPromisc,
425 Ipv4Address promiscSource) override;
426
427 private:
428 /**
429 * @brief The route cache.
430 */
432 /**
433 * @brief The ip layer 3.
434 */
436};
437
438/**
439 * @class DsrOptionSR
440 * @brief Dsr Option Source Route
441 */
443{
444 public:
445 /**
446 * @brief Source Route option number.
447 */
448 static const uint8_t OPT_NUMBER = 96;
449
450 /**
451 * @brief Get the type ID.
452 * @return the object TypeId
453 */
454 static TypeId GetTypeId();
455 /**
456 * @brief Get the instance type ID.
457 * @return instance type ID
458 */
459 TypeId GetInstanceTypeId() const override;
460
461 DsrOptionSR();
462 ~DsrOptionSR() override;
463
464 uint8_t GetOptionNumber() const override;
465 uint8_t Process(Ptr<Packet> packet,
466 Ptr<Packet> dsrP,
467 Ipv4Address ipv4Address,
468 Ipv4Address source,
469 const Ipv4Header& ipv4Header,
470 uint8_t protocol,
471 bool& isPromisc,
472 Ipv4Address promiscSource) override;
473
474 private:
475 /**
476 * @brief The ip layer 3.
477 */
479};
480
481/**
482 * @class DsrOptionRerr
483 * @brief Dsr Option Route Error
484 */
486{
487 public:
488 /**
489 * @brief Dsr Route Error option number.
490 */
491 static const uint8_t OPT_NUMBER = 3;
492
493 /**
494 * @brief Get the type ID.
495 * @return the object TypeId
496 */
497 static TypeId GetTypeId();
498 /**
499 * @brief Get the instance type ID.
500 * @return instance type ID
501 */
502 TypeId GetInstanceTypeId() const override;
503
505 ~DsrOptionRerr() override;
506
507 uint8_t GetOptionNumber() const override;
508 uint8_t Process(Ptr<Packet> packet,
509 Ptr<Packet> dsrP,
510 Ipv4Address ipv4Address,
511 Ipv4Address source,
512 const Ipv4Header& ipv4Header,
513 uint8_t protocol,
514 bool& isPromisc,
515 Ipv4Address promiscSource) override;
516 /**
517 * @brief Do Send error message
518 *
519 * @param p the packet
520 * @param rerr the DsrOptionRerrUnreachHeader header
521 * @param rerrSize the route error header size
522 * @param ipv4Address ipv4 address of our own
523 * @param protocol the protocol number of the up layer
524 * @return the processed size
525 */
526 uint8_t DoSendError(Ptr<Packet> p,
528 uint32_t rerrSize,
529 Ipv4Address ipv4Address,
530 uint8_t protocol);
531
532 private:
533 /**
534 * @brief The route cache.
535 */
537 /**
538 * @brief The ipv4 layer 3.
539 */
541};
542
543/**
544 * @class DsrOptionAckReq
545 * @brief Dsr Option
546 */
548{
549 public:
550 /**
551 * @brief Dsr ack request option number.
552 */
553 static const uint8_t OPT_NUMBER = 160;
554
555 /**
556 * @brief Get the type ID.
557 * @return the object TypeId
558 */
559 static TypeId GetTypeId();
560 /**
561 * @brief Get the instance type ID.
562 * @return instance type ID
563 */
564 TypeId GetInstanceTypeId() const override;
565
567 ~DsrOptionAckReq() override;
568
569 uint8_t GetOptionNumber() const override;
570 uint8_t Process(Ptr<Packet> packet,
571 Ptr<Packet> dsrP,
572 Ipv4Address ipv4Address,
573 Ipv4Address source,
574 const Ipv4Header& ipv4Header,
575 uint8_t protocol,
576 bool& isPromisc,
577 Ipv4Address promiscSource) override;
578
579 private:
580 /**
581 * @brief The route cache.
582 */
584 /**
585 * @brief The ipv4 layer 3.
586 */
588};
589
590/**
591 * @class DsrOptionAck
592 * @brief Dsr Option Ack
593 */
595{
596 public:
597 /**
598 * @brief The Dsr Ack option number.
599 */
600 static const uint8_t OPT_NUMBER = 32;
601
602 /**
603 * @brief Get the type ID.
604 * @return the object TypeId
605 */
606 static TypeId GetTypeId();
607 /**
608 * @brief Get the instance type ID.
609 * @return instance type ID
610 */
611 TypeId GetInstanceTypeId() const override;
612
613 DsrOptionAck();
614 ~DsrOptionAck() override;
615
616 uint8_t GetOptionNumber() const override;
617 uint8_t Process(Ptr<Packet> packet,
618 Ptr<Packet> dsrP,
619 Ipv4Address ipv4Address,
620 Ipv4Address source,
621 const Ipv4Header& ipv4Header,
622 uint8_t protocol,
623 bool& isPromisc,
624 Ipv4Address promiscSource) override;
625
626 private:
627 /**
628 * @brief The route cache.
629 */
631 /**
632 * @brief The ipv4 layer 3.
633 */
635};
636} // namespace dsr
637} // Namespace ns3
638
639#endif
Ipv4 addresses are stored in host order in this class.
Packet header for IPv4.
Definition ipv4-header.h:23
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:48
Dsr Option Ack.
uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, const Ipv4Header &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource) override
Process method.
Ptr< Ipv4 > m_ipv4
The ipv4 layer 3.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
static const uint8_t OPT_NUMBER
The Dsr Ack option number.
static TypeId GetTypeId()
Get the type ID.
Ptr< dsr::DsrRouteCache > m_routeCache
The route cache.
uint8_t GetOptionNumber() const override
Get the option number.
static TypeId GetTypeId()
Get the type ID.
uint8_t GetOptionNumber() const override
Get the option number.
uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, const Ipv4Header &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource) override
Process method.
static const uint8_t OPT_NUMBER
Dsr ack request option number.
Ptr< dsr::DsrRouteCache > m_routeCache
The route cache.
Ptr< Ipv4 > m_ipv4
The ipv4 layer 3.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Dsr Option Pad1.
uint8_t GetOptionNumber() const override
Get the option number.
static TypeId GetTypeId()
Get the type ID.
uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, const Ipv4Header &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource) override
Process method.
static const uint8_t OPT_NUMBER
Pad1 option number.
IPv4 Option Padn.
static const uint8_t OPT_NUMBER
PadN option number.
uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, const Ipv4Header &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource) override
Process method.
static TypeId GetTypeId()
Get the type ID.
uint8_t GetOptionNumber() const override
Get the option number.
Dsr Option Route Error.
Ptr< Ipv4 > m_ipv4
The ipv4 layer 3.
uint8_t DoSendError(Ptr< Packet > p, DsrOptionRerrUnreachHeader &rerr, uint32_t rerrSize, Ipv4Address ipv4Address, uint8_t protocol)
Do Send error message.
Ptr< dsr::DsrRouteCache > m_routeCache
The route cache.
static const uint8_t OPT_NUMBER
Dsr Route Error option number.
static TypeId GetTypeId()
Get the type ID.
uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, const Ipv4Header &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource) override
Process method.
uint8_t GetOptionNumber() const override
Get the option number.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Route Error (RERR) Unreachable node address option Message Format.
Dsr Option Route Reply.
Ptr< Ipv4 > m_ipv4
The ip layer 3.
static const uint8_t OPT_NUMBER
Router alert option number.
static TypeId GetTypeId()
Get the type ID.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
uint8_t GetOptionNumber() const override
Get the option number.
Ptr< dsr::DsrRouteCache > m_routeCache
The route cache.
uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, const Ipv4Header &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource) override
Process method.
Dsr Option Rreq.
static TypeId GetTypeId()
Get the type ID.
Ptr< Ipv4 > m_ipv4
The ipv4.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
static const uint8_t OPT_NUMBER
Rreq option number.
Ptr< dsr::DsrRouteCache > m_routeCache
The route cache.
uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, const Ipv4Header &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource) override
Process method.
uint8_t GetOptionNumber() const override
Get the option number.
~DsrOptionRreq() override
Destructor.
DsrOptionRreq()
Constructor.
Dsr Option Source Route.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
static const uint8_t OPT_NUMBER
Source Route option number.
Ptr< Ipv4 > m_ipv4
The ip layer 3.
uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, const Ipv4Header &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource) override
Process method.
uint8_t GetOptionNumber() const override
Get the option number.
static TypeId GetTypeId()
Get the type ID.
Introspection did not find any typical Config paths.
Definition dsr-options.h:65
Ipv4Address SearchNextHop(Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
Search for the next hop in the route.
Ipv4Address ReverseSearchNextTwoHop(Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
Reverse search for the next two hop in the route.
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, const Ipv4Header &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)=0
Process method.
TracedCallback< Ptr< const Packet > > m_dropTrace
Drop trace callback.
Ptr< Node > GetNodeWithAddress(Ipv4Address ipv4Address)
Get the node object with Ipv4Address.
DsrOptions()
Constructor.
Ptr< Node > GetNode() const
Get the node.
Time ActiveRouteTimeout
The active route timeout value.
bool CheckDuplicates(Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
Check if the route already contains the node ip address.
void SetNode(Ptr< Node > node)
Set the node.
virtual uint8_t GetOptionNumber() const =0
Get the option number.
Ptr< dsr::DsrRreqTable > m_rreqTable
The route request table.
~DsrOptions() override
Destructor.
std::vector< Ipv4Address > m_finalRoute
The vector of final Ipv4 address.
void PrintVector(std::vector< Ipv4Address > &vec)
Print out the elements in the route vector.
bool IfDuplicates(std::vector< Ipv4Address > &vec, std::vector< Ipv4Address > &vec2)
Check if the two vectors contain duplicate or not.
bool ReverseRoutes(std::vector< Ipv4Address > &vec)
Reverse the routes.
void RemoveDuplicates(std::vector< Ipv4Address > &vec)
Remove the duplicates from the route.
uint32_t GetIDfromIP(Ipv4Address address)
Get the node id with Ipv4Address.
Ipv4Address Broadcast
The broadcast IP address.
static TypeId GetTypeId()
Get the type identificator.
std::vector< Ipv4Address > CutRoute(Ipv4Address ipv4Address, std::vector< Ipv4Address > &nodeList)
Cut the route from ipv4Address to the end of the route vector.
bool ContainAddressAfter(Ipv4Address ipv4Address, Ipv4Address destAddress, std::vector< Ipv4Address > &nodeList)
Search for the ipv4 address in the node list.
TracedCallback< const DsrOptionSRHeader & > m_rxPacketTrace
The receive trace back, only triggered when final destination receive data packet.
Ipv4Address ReverseSearchNextHop(Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
Reverse search for the next hop in the route.
Ptr< Ipv4 > m_ipv4
The ipv4.
void ScheduleReply(Ptr< Packet > &packet, std::vector< Ipv4Address > &nodeList, Ipv4Address &source, Ipv4Address &destination)
Schedule the intermediate node route request broadcast.
Ptr< dsr::DsrRouteCache > m_routeCache
The route cache table.
Ptr< Ipv4Route > m_ipv4Route
The ipv4 route.
std::vector< Ipv4Address > m_ipv4Address
The vector of Ipv4 address.
virtual Ptr< Ipv4Route > SetRoute(Ipv4Address nextHop, Ipv4Address srcAddress)
Set the route to use for data packets, used by the option headers when sending data/control packets.
Ptr< Node > m_node
the node
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition nstime.h:864
Every class exported by the ns3 library is enclosed in the ns3 namespace.