32 #define NS_LOG_APPEND_CONTEXT \
33 if (GetObject<Node> ()) { std::clog << "[node " << GetObject<Node> ()->GetId () << "] "; }
41 #include "ns3/assert.h"
42 #include "ns3/fatal-error.h"
44 #include "ns3/uinteger.h"
45 #include "ns3/trace-source-accessor.h"
46 #include "ns3/udp-header.h"
47 #include "ns3/pointer.h"
48 #include "ns3/node-list.h"
49 #include "ns3/uinteger.h"
50 #include "ns3/object-vector.h"
51 #include "ns3/ipv4-l3-protocol.h"
52 #include "ns3/ipv4-interface.h"
53 #include "ns3/ipv4-header.h"
54 #include "ns3/ipv4-address.h"
55 #include "ns3/ipv4-route.h"
56 #include "ns3/icmpv4-l4-protocol.h"
57 #include "ns3/ip-l4-protocol.h"
74 .AddAttribute (
"OptionNumber",
"The Dsr option number.",
77 MakeUintegerChecker<uint8_t> ())
78 .AddTraceSource (
"Rx",
"Receive DSR packet.",
109 std::vector<Ipv4Address>::iterator it = find (nodeList.begin (), nodeList.end (), destAddress);
111 for (std::vector<Ipv4Address>::iterator i = it; i != nodeList.end (); ++i)
113 if ((ipv4Address == (*i)) && ((*i) != nodeList.back ()))
121 std::vector<Ipv4Address>
125 std::vector<Ipv4Address>::iterator it = find (nodeList.begin (), nodeList.end (), ipv4Address);
126 std::vector<Ipv4Address> cutRoute;
127 for (std::vector<Ipv4Address>::iterator i = it; i != nodeList.end (); ++i)
129 cutRoute.push_back (*i);
147 std::vector<Ipv4Address> vec2 (vec);
149 for (std::vector<Ipv4Address>::reverse_iterator ri = vec2.rbegin (); ri
150 != vec2.rend (); ++ri)
155 if ((vec.size () == vec2.size ()) && (vec.front () == vec2.back ()))
167 if (vec.size () == 2)
175 if (ipv4Address == vec.back ())
177 NS_LOG_DEBUG (
"We have reached to the final destination " << ipv4Address <<
" " << vec.back ());
180 for (std::vector<Ipv4Address>::const_iterator i = vec.begin (); i != vec.end (); ++i)
182 if (ipv4Address == (*i))
189 NS_LOG_DEBUG (
"next hop address not found, route corrupted");
198 if (vec.size () == 2)
206 for (std::vector<Ipv4Address>::reverse_iterator ri = vec.rbegin (); ri != vec.rend (); ++ri)
208 if (ipv4Address == (*ri))
215 NS_LOG_DEBUG (
"next hop address not found, route corrupted");
226 for (std::vector<Ipv4Address>::reverse_iterator ri = vec.rbegin (); ri != vec.rend (); ++ri)
228 if (ipv4Address == (*ri))
230 nextTwoHop = *(ri + 2);
252 for (std::vector<Ipv4Address>::const_iterator i = vec.begin (); i != vec.end (); ++i)
262 for (std::vector<Ipv4Address>::const_iterator i = vec.begin (); i != vec.end (); ++i)
264 for (std::vector<Ipv4Address>::const_iterator j = vec2.begin (); j != vec2.end (); ++j)
282 for (std::vector<Ipv4Address>::const_iterator i = vec.begin (); i != vec.end (); ++i)
284 if ((*i) == ipv4Address)
300 std::vector<Ipv4Address> vec2 (vec);
303 for (std::vector<Ipv4Address>::const_iterator i = vec2.begin (); i != vec2.end (); ++i)
312 for (std::vector<Ipv4Address>::iterator j = vec.begin (); j != vec.end (); ++j)
316 if ((j + 1) != vec.end ())
318 vec.erase (j + 1, vec.end ());
326 else if (j == (vec.end () - 1))
345 for (int32_t i = 0; i < nNodes; ++i)
349 if (ipv4->GetAddress (1, 0).GetLocal () ==
address)
361 for (int32_t i = 0; i < nNodes; ++i)
365 int32_t ifIndex = ipv4->GetInterfaceForAddress (ipv4Address);
380 .AddConstructor<DsrOptionPad1> ()
404 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
420 .AddConstructor<DsrOptionPadn> ()
443 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
460 .AddConstructor<DsrOptionRreq> ()
489 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
496 if (source == ipv4Address)
498 NS_LOG_DEBUG (
"Discard the packet since it was originated from same source address");
515 uint8_t numberAddress = (buf[1] - 6) / 4;
516 NS_LOG_DEBUG (
"The number of Ip addresses " << (uint32_t)numberAddress);
517 if (numberAddress >= 255)
519 NS_LOG_DEBUG (
"Discard the packet, malformed header since two many ip addresses in route");
533 p->RemoveHeader (rreq);
543 uint16_t requestId = rreq.
GetId ();
548 std::vector<Ipv4Address> nodeList (mainVector);
566 uint8_t ttl = ipv4Header.
GetTtl ();
567 bool dupRequest =
false;
572 dupRequest = dsr->FindSourceEntry (sourceAddress, targetAddress, requestId);
595 NS_LOG_DEBUG (
"Our node address is already seen in the route, drop the request");
602 bool isRouteInCache = dsr->LookupRoute (targetAddress,
606 std::vector<Ipv4Address> saveRoute (nodeList);
621 NS_LOG_DEBUG (
"The target address over here " << targetAddress <<
" and the ip address " << ipv4Address <<
" and the source address " << mainVector[0]);
622 if (targetAddress == ipv4Address)
625 if (nodeList.size () == 1)
632 nextHop = srcAddress;
636 std::vector<Ipv4Address> changeRoute (nodeList);
637 changeRoute.push_back (ipv4Address);
639 for (std::vector<Ipv4Address>::iterator i = changeRoute.begin (); i != changeRoute.end (); ++i)
667 dsr->ScheduleInitialReply (newPacket, ipv4Address, nextHop,
m_ipv4Route);
676 bool addRoute =
false;
677 if (numberAddress > 0)
681 if (dsr->IsLinkCache ())
683 addRoute = dsr->AddRoute_Link (
m_finalRoute, ipv4Address);
687 addRoute = dsr->AddRoute (toSource);
718 if (nextHop ==
"0.0.0.0")
720 dsr->PacketNewRoute (dsrP, ipv4Address, dst, protocol);
727 dsr->SendPacketFromBuffer (sourceRoute, nextHop, protocol);
729 dsr->CancelRreqTimer (dst,
true);
753 else if (isRouteInCache && !areThereDuplicates)
759 for (std::vector<Ipv4Address>::iterator i = saveRoute.begin (); i != saveRoute.end (); ++i)
766 for (std::vector<Ipv4Address>::iterator j = ip.begin (); j != ip.end (); ++j)
773 bool addRoute =
false;
778 saveRoute.push_back (ipv4Address);
785 NS_ASSERT (saveRoute.front () == ipv4Address);
787 if (dsr->IsLinkCache ())
789 addRoute = dsr->AddRoute_Link (saveRoute, ipv4Address);
793 addRoute = dsr->AddRoute (toSource);
798 NS_LOG_LOGIC (
"We have added the route and search send buffer for packet with destination " << dst);
816 if (nextHop ==
"0.0.0.0")
818 dsr->PacketNewRoute (dsrP, ipv4Address, dst, protocol);
825 dsr->SendPacketFromBuffer (sourceRoute, nextHop, protocol);
827 dsr->CancelRreqTimer (dst,
true);
864 dsrRoutingHeader.SetMessageType (1);
865 dsrRoutingHeader.SetSourceId (
GetIDfromIP (realSource));
866 dsrRoutingHeader.SetDestId (255);
869 dsrRoutingHeader.SetPayloadLength (length + 2);
870 dsrRoutingHeader.AddDsrOption (rrep);
873 dsr->ScheduleCachedReply (newPacket, ipv4Address, nextHop,
m_ipv4Route, hops);
882 mainVector.push_back (ipv4Address);
883 NS_ASSERT (mainVector.front () == source);
893 p->RemoveHeader (rerr);
898 if ((errorSrc == srcAddress) && (unreachNode == ipv4Address))
908 dsr->DeleteAllRoutesIncludeLink (errorSrc, unreachNode, ipv4Address);
917 NS_LOG_DEBUG (
"The RREQ and newUnreach header length " << length);
931 uint8_t ttl = ipv4Header.
GetTtl ();
944 dsr->ScheduleInterRequest (interP);
959 .AddConstructor<DsrOptionRrep> ()
988 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
995 uint8_t numberAddress = (buf[1] - 2) / 4;
1004 NS_LOG_DEBUG (
"The next header value " << (uint32_t)protocol);
1012 if (targetAddress == ipv4Address)
1016 if (nodeList.size () == 0)
1031 NS_ASSERT (nodeList.front () == ipv4Address);
1032 bool addRoute =
false;
1033 if (dsr->IsLinkCache ())
1035 addRoute = dsr->AddRoute_Link (nodeList, ipv4Address);
1039 addRoute = dsr->AddRoute (toDestination);
1044 NS_LOG_DEBUG (
"We have added the route and search send buffer for packet with destination " << dst);
1049 NS_LOG_DEBUG (
"The route length " << nodeList.size ());
1055 if (nextHop ==
"0.0.0.0")
1057 dsr->PacketNewRoute (dsrP, ipv4Address, dst, protocol);
1063 dsr->CancelRreqTimer (dst,
true);
1067 dsr->SendPacketFromBuffer (sourceRoute, nextHop, protocol);
1078 NS_LOG_DEBUG (
"The length of rrep option " << (uint32_t)length);
1080 if (length % 2 != 0)
1090 std::vector<Ipv4Address> routeCopy = nodeList;
1091 std::vector<Ipv4Address> cutRoute =
CutRoute (ipv4Address, nodeList);
1093 if (cutRoute.size () >= 2)
1096 NS_LOG_DEBUG (
"The route destination after cut " << dst);
1098 NS_ASSERT (cutRoute.front () == ipv4Address);
1099 bool addRoute =
false;
1100 if (dsr->IsLinkCache ())
1102 addRoute = dsr->AddRoute_Link (nodeList, ipv4Address);
1106 addRoute = dsr->AddRoute (toDestination);
1110 dsr->CancelRreqTimer (dst,
true);
1125 NS_ASSERT (routeCopy.back () == source);
1127 NS_LOG_DEBUG (
"The nextHop address " << nextHop <<
" and the source in the route reply " << source);
1139 NS_LOG_DEBUG (
"The reply header length " << (uint32_t)length);
1146 newPacket->
AddHeader (dsrRoutingHeader);
1147 dsr->SendReply (newPacket, ipv4Address, nextHop,
m_ipv4Route);
1159 .AddConstructor<DsrOptionSR> ()
1187 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Address << ipv4Header << (uint32_t)protocol << isPromisc);
1192 uint8_t numberAddress = (buf[1] - 2) / 4;
1221 NS_LOG_LOGIC (
"We process promiscuous receipt data packet");
1225 dsr->SendGratuitousReply (source, srcAddress, nodeList, protocol);
1231 if (destAddress != destination)
1233 NS_LOG_DEBUG (
"Process the promiscuously received packet");
1234 bool findPassive =
false;
1236 for (int32_t i = 0; i < nNodes; ++i)
1243 findPassive = dsrNode->PassiveEntryCheck (packet, source, destination, segsLeft, fragmentOffset, identification,
false);
1252 NS_LOG_DEBUG (
"We find one previously received passive entry");
1262 dsrSrc->CancelPassiveTimer (packet, source, destination, segsLeft);
1267 dsr->PassiveEntryCheck (packet, source, destination, segsLeft, fragmentOffset, identification,
true);
1278 uint8_t length = sourceRoute.
GetLength ();
1279 uint8_t nextAddressIndex;
1283 uint32_t size = p->
GetSize ();
1284 uint8_t *
data =
new uint8_t[size];
1286 uint8_t optionType = 0;
1287 optionType = *(
data);
1290 if (optionType == 160)
1292 NS_LOG_LOGIC (
"Remove the ack request header and add ack header to the packet");
1296 uint16_t ackId = ackReq.
GetAckId ();
1303 if (!nodeList.empty ())
1305 if (segsLeft > numberAddress)
1312 if (numberAddress - segsLeft < 2)
1318 ackAddress = nodeList[numberAddress - segsLeft - 2];
1321 NS_LOG_DEBUG (
"Send back ACK to the earlier hop " << ackAddress <<
" from us " << ipv4Address);
1322 dsr->SendAck (ackId, ackAddress, source, destination, protocol,
m_ipv4Route);
1335 if (length % 2 != 0)
1342 if (segsLeft > numberAddress)
1353 nextAddressIndex = numberAddress - segsLeft;
1355 NS_LOG_DEBUG (
"The next address of source route option " << nextAddress <<
" and the nextAddressIndex: " << (uint32_t)nextAddressIndex <<
" and the segments left : " << (uint32_t)segsLeft);
1367 if (nextHop ==
"0.0.0.0")
1370 dsr->PacketNewRoute (dsrP, realSource, targetAddress, protocol);
1374 if (ipv4Address == nextHop)
1387 SetRoute (nextAddress, ipv4Address);
1389 dsr->ForwardPacket (dsrP, newSourceRoute, ipv4Header, realSource, nextAddress, targetAddress, protocol,
m_ipv4Route);
1400 .AddConstructor<DsrOptionRerr> ()
1428 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
1430 uint32_t size = p->
GetSize ();
1431 uint8_t *
data =
new uint8_t[size];
1433 uint8_t errorType = *(data + 2);
1443 NS_LOG_DEBUG (
"The error type value here " << (uint32_t)errorType);
1457 NS_LOG_DEBUG (
"The error source is " << rerrUnreach.
GetErrorDst () <<
"and the unreachable node is " << unreachAddress);
1466 dsr->DeleteAllRoutesIncludeLink (errorSource, unreachAddress, ipv4Address);
1469 uint32_t serialized =
DoSendError (newP, rerrUnreach, rerrSize, ipv4Address, protocol);
1488 uint32_t serialized = 0;
1498 uint8_t numberAddress = (buf[1] - 2) / 4;
1501 NS_LOG_DEBUG (
"The number of addresses " << (uint32_t)numberAddress);
1515 uint8_t length = sourceRoute.
GetLength ();
1516 uint8_t nextAddressIndex;
1528 if (length % 2 != 0)
1535 if (segmentsLeft > numberAddress)
1544 if (segmentsLeft == 0 && targetAddress == ipv4Address)
1546 NS_LOG_INFO (
"This is the destination of the error, send error request");
1547 dsr->SendErrorRequest (rerr, protocol);
1548 return serializedSize;
1554 nextAddressIndex = numberAddress - segmentsLeft;
1564 return serializedSize;
1568 SetRoute (nextAddress, ipv4Address);
1569 dsr->ForwardErrPacket (rerr, newSourceRoute, nextAddress, protocol,
m_ipv4Route);
1570 return serializedSize;
1577 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionAckReq")
1579 .AddConstructor<DsrOptionAckReq> ()
1607 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
1623 NS_LOG_DEBUG (
"The next header value " << (uint32_t)protocol);
1634 .AddConstructor<DsrOptionAck> ()
1662 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
1680 dsr->UpdateRouteEntry (realDst);
1684 dsr->CallCancelPacketTimer (ackId, ipv4Header, realSrc, realDst);
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
static const uint8_t OPT_NUMBER
Dsr Route Error option number.
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method.
virtual uint8_t GetOptionNumber() const
Get the option number.
static const uint8_t OPT_NUMBER
Rreq option number.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
static uint32_t GetNNodes(void)
static const uint8_t OPT_NUMBER
Dsr ack request option number.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
static TypeId GetTypeId()
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
static Ptr< Node > GetNode(uint32_t n)
Doxygen introspection did not find any typical Config paths.
static TypeId GetTypeId()
void AddPacketTag(const Tag &tag) const
Add a packet tag.
virtual uint8_t GetOptionNumber() const =0
Get the option number.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
bool IsMulticast(void) const
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_FATAL_ERROR(msg)
fatal error handling
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method.
Doxygen introspection did not find any typical Config paths.
This class implements a tag that carries the socket-specific TTL of a packet to the IP layer...
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
void SetNode(Ptr< Node > node)
Set the node.
static const uint8_t OPT_NUMBER
Pad1 option number.
uint8_t DoSendError(Ptr< Packet > p, DsrOptionRerrUnreachHeader &rerr, uint32_t rerrSize, Ipv4Address ipv4Address, uint8_t protocol)
Do Send error message.
uint32_t GetIDfromIP(Ipv4Address address)
Get the node id with Ipv4Address.
void SetSource(Ipv4Address src)
virtual uint8_t GetOptionNumber() const
Get the option number.
void SetTtl(uint8_t ttl)
Set the tag's TTL.
Doxygen introspection did not find any typical Config paths.
static TypeId GetTypeId()
void SetGateway(Ipv4Address gw)
Hold an unsigned integer type.
DsrOptionRreq()
Constructor.
std::vector< Ipv4Address > IP_VECTOR
Define the vector to hold Ip address.
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, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method.
TracedCallback< Ptr< const Packet > > m_dropTrace
Drop trace callback.
static const uint8_t OPT_NUMBER
Router alert option number.
static TypeId GetTypeId()
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method.
static const uint8_t OPT_NUMBER
PadN option number.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
virtual ~DsrOptionRreq()
Destructor.
std::vector< Ipv4Address > m_finalRoute
The vector of final Ipv4 address.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
Access to the Ipv4 forwarding table, interfaces, and configuration.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
void RemoveDuplicates(std::vector< Ipv4Address > &vec)
Remove the duplicates from the route.
Time ActiveRouteTimeout
The active route timeout value.
void PrintVector(std::vector< Ipv4Address > &vec)
Print out the elements in the route vector.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
static const uint8_t OPT_NUMBER
The Dsr Ack option number.
Ipv4Address SearchNextHop(Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
Search for the next hop in the route.
Doxygen introspection did not find any typical Config paths.
IP_VECTOR GetVector() const
TracedCallback< const DsrOptionSRHeader & > m_rxPacketTrace
The receive trace back, only triggered when final destination receive data packet.
static TypeId GetTypeId()
virtual ~DsrOptions()
Destructor.
Ipv4 addresses are stored in host order in this class.
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method.
static TypeId GetTypeId()
Doxygen introspection did not find any typical Config paths.
Doxygen introspection did not find any typical Config paths.
void AddDsrOption(DsrOptionHeader const &option)
Serialize the option, prepending pad1 or padn option as necessary.
bool CheckDuplicates(Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
Check if the route already contains the node ip address.
bool ReverseRoutes(std::vector< Ipv4Address > &vec)
Reverse the routes.
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Ptr< Ipv4Route > m_ipv4Route
The ipv4 route.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
Ipv4Address ReverseSearchNextHop(Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
Reverse search for the next hop in the route.
virtual ~DsrOptionAckReq()
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
static TypeId GetTypeId(void)
Get the type identificator.
bool ContainAddressAfter(Ipv4Address ipv4Address, Ipv4Address destAddress, std::vector< Ipv4Address > &nodeList)
Search for the ipv4 address in the node list.
virtual uint8_t GetOptionNumber() const
Get the option number.
virtual uint8_t GetOptionNumber() const
Get the option number.
virtual uint8_t GetOptionNumber() const
Get the option number.
Doxygen introspection did not find any typical Config paths.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
static const uint8_t OPT_NUMBER
Source Route option number.
Doxygen introspection did not find any typical Config paths.
virtual uint8_t GetOptionNumber() const
Get the option number.
a base class which provides memory management and object aggregation
Doxygen introspection did not find any typical Config paths.
Ptr< Node > GetNode() const
Get the node.
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...
bool IfDuplicates(std::vector< Ipv4Address > &vec, std::vector< Ipv4Address > &vec2)
Check if the two vectors contain duplicate or not.
Ptr< Node > GetNodeWithAddress(Ipv4Address ipv4Address)
Get the node object with Ipv4Address.
static TypeId GetTypeId()
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method.
Ptr< T > GetObject(void) const
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
void AddHeader(const Header &header)
Add header to this packet.
void SetDestination(Ipv4Address dest)
std::vector< Ipv4Address > CutRoute(Ipv4Address ipv4Address, std::vector< Ipv4Address > &nodeList)
Cut the route from ipv4Address to the end of the route vector.
virtual uint8_t GetOptionNumber() const
Get the option number.
static TypeId GetTypeId()
virtual uint8_t GetOptionNumber() const
Get the option number.