A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
nix-vector-routing.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 The Georgia Institute of Technology
3 * Copyright (c) 2021 NITK Surathkal
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 * This file is adapted from the old ipv4-nix-vector-routing.h.
8 *
9 * Authors: Josh Pelkey <jpelkey@gatech.edu>
10 *
11 * Modified by: Ameya Deshpande <ameyanrd@outlook.com>
12 */
13
14#ifndef NIX_VECTOR_ROUTING_H
15#define NIX_VECTOR_ROUTING_H
16
17#include "ns3/bridge-net-device.h"
18#include "ns3/channel.h"
19#include "ns3/ipv4-interface.h"
20#include "ns3/ipv4-l3-protocol.h"
21#include "ns3/ipv4-route.h"
22#include "ns3/ipv4-routing-protocol.h"
23#include "ns3/ipv6-interface.h"
24#include "ns3/ipv6-l3-protocol.h"
25#include "ns3/ipv6-route.h"
26#include "ns3/ipv6-routing-protocol.h"
27#include "ns3/net-device-container.h"
28#include "ns3/nix-vector.h"
29#include "ns3/node-container.h"
30#include "ns3/node-list.h"
31#include "ns3/nstime.h"
32
33#include <map>
34#include <unordered_map>
35
36// NOLINTBEGIN(modernize-use-override)
37
38namespace ns3
39{
40
41/**
42 * @defgroup nix-vector-routing Nix-Vector Routing
43 *
44 * Nix-vector routing is a simulation specific routing protocol and is
45 * intended for large network topologies.
46 */
47
48/**
49 * @ingroup nix-vector-routing
50 * Nix-vector routing protocol
51 *
52 * @internal
53 * Since this class is meant to be specialized only by Ipv4RoutingProtocol or
54 * Ipv6RoutingProtocol the implementation of this class doesn't need to be
55 * exposed here; it is in nix-vector-routing.cc.
56 */
57template <typename T>
58class NixVectorRouting : public std::enable_if_t<std::is_same_v<Ipv4RoutingProtocol, T> ||
59 std::is_same_v<Ipv6RoutingProtocol, T>,
60 T>
61{
62 /// Alias for determining whether the parent is Ipv4RoutingProtocol or Ipv6RoutingProtocol
63 static constexpr bool IsIpv4 = std::is_same_v<Ipv4RoutingProtocol, T>;
64
65 /// Alias for Ipv4 and Ipv6 classes
66 using Ip = typename std::conditional_t<IsIpv4, Ipv4, Ipv6>;
67
68 /// Alias for Ipv4Address and Ipv6Address classes
69 using IpAddress = typename std::conditional_t<IsIpv4, Ipv4Address, Ipv6Address>;
70
71 /// Alias for Ipv4Route and Ipv6Route classes
72 using IpRoute = typename std::conditional_t<IsIpv4, Ipv4Route, Ipv6Route>;
73
74 /// Alias for Ipv4Header and Ipv6Header classes
75 using IpHeader = typename std::conditional_t<IsIpv4, Ipv4Header, Ipv6Header>;
76
77 /// Alias for Ipv4InterfaceAddress and Ipv6InterfaceAddress classes
79 typename std::conditional_t<IsIpv4, Ipv4InterfaceAddress, Ipv6InterfaceAddress>;
80
81 /// Alias for Ipv4Interface and Ipv6Interface classes
82 using IpInterface = typename std::conditional_t<IsIpv4, Ipv4Interface, Ipv6Interface>;
83
84 /// Alias for Ipv4L3Protocol and Ipv4L3Protocol classes
85 using IpL3Protocol = typename std::conditional_t<IsIpv4, Ipv4L3Protocol, Ipv6L3Protocol>;
86
87 public:
90 /**
91 * @brief The Interface ID of the Global Router interface.
92 * @return The Interface ID
93 * @see Object::GetObject ()
94 */
95 static TypeId GetTypeId();
96 /**
97 * @brief Set the Node pointer of the node for which this
98 * routing protocol is to be placed
99 *
100 * @param node Node pointer
101 */
102 void SetNode(Ptr<Node> node);
103
104 /**
105 * @brief Called when run-time link topology change occurs
106 * which iterates through the node list and flushes any
107 * nix vector caches
108 *
109 * @internal
110 * \c const is used here due to need to potentially flush the cache
111 * in const methods such as PrintRoutingTable. Caches are stored in
112 * mutable variables and flushed in const methods.
113 */
115
116 /**
117 * @brief Print the Routing Path according to Nix Routing
118 * @param source Source node
119 * @param dest Destination node address
120 * @param stream The ostream the Routing path is printed to
121 * @param unit the time unit to be used in the report
122 *
123 * @note IpAddress is alias for either Ipv4Address or Ipv6Address
124 * depending on on whether the network is IPv4 or IPv6 respectively.
125 */
127 IpAddress dest,
129 Time::Unit unit) const;
130
131 private:
132 /**
133 * Flushes the cache which stores nix-vector based on
134 * destination IP
135 */
136 void FlushNixCache() const;
137
138 /**
139 * Flushes the cache which stores the Ip route
140 * based on the destination IP
141 */
142 void FlushIpRouteCache() const;
143
144 /**
145 * Upon a run-time topology change caches are
146 * flushed and the total number of neighbors is
147 * reset to zero
148 */
150
151 /**
152 * Takes in the source node and dest IP and calls GetNodeByIp,
153 * BFS, accounting for any output interface specified, and finally
154 * BuildNixVector to return the built nix-vector
155 *
156 * @param source Source node
157 * @param dest Destination node address
158 * @param oif Preferred output interface
159 * @returns The NixVector to be used in routing.
160 */
162
163 /**
164 * Checks the cache based on dest IP for the nix-vector
165 * @param address Address to check
166 * @param foundInCache Address found in cache
167 * @returns The NixVector to be used in routing.
168 */
169 Ptr<NixVector> GetNixVectorInCache(const IpAddress& address, bool& foundInCache) const;
170
171 /**
172 * Checks the cache based on dest IP for the IpRoute
173 * @param address Address to check
174 * @returns The cached route.
175 */
177
178 /**
179 * Given a net-device returns all the adjacent net-devices,
180 * essentially getting the neighbors on that channel
181 * @param [in] netDevice the NetDevice attached to the channel.
182 * @param [in] channel the channel to check
183 * @param [out] netDeviceContainer the NetDeviceContainer of the NetDevices in the channel.
184 */
186 Ptr<Channel> channel,
187 NetDeviceContainer& netDeviceContainer) const;
188
189 /**
190 * Iterates through the node list and finds the one
191 * corresponding to the given IpAddress
192 * @param dest destination node IP
193 * @return The node with the specified IP.
194 */
196
197 /**
198 * Iterates through the node list and finds the one
199 * corresponding to the given IpAddress
200 * @param netDevice NetDevice pointer
201 * @return The node with the specified IP.
202 */
204
205 /**
206 * Recurses the T vector, created by BFS and actually builds the nixvector
207 * @param [in] parentVector Parent vector for retracing routes
208 * @param [in] source Source Node index
209 * @param [in] dest Destination Node index
210 * @param [out] nixVector the NixVector to be used for routing
211 * @returns true on success, false otherwise.
212 */
213 bool BuildNixVector(const std::vector<Ptr<Node>>& parentVector,
214 uint32_t source,
215 uint32_t dest,
216 Ptr<NixVector> nixVector) const;
217
218 /**
219 * Simply iterates through the nodes net-devices and determines
220 * how many neighbors the node has.
221 * @param [in] node node pointer
222 * @returns the number of neighbors of m_node.
223 */
225
226 /**
227 * Determine if the NetDevice is bridged
228 * @param nd the NetDevice to check
229 * @returns the bridging NetDevice (or null if the NetDevice is not bridged)
230 */
232
233 /**
234 * Nix index is with respect to the neighbors. The net-device index must be
235 * derived from this
236 * @param [in] node the current node under consideration
237 * @param [in] nodeIndex Nix Node index
238 * @param [out] gatewayIp IP address of the gateway
239 * @returns the index of the NetDevice in the node.
240 */
242 uint32_t nodeIndex,
243 IpAddress& gatewayIp) const;
244
245 /**
246 * @brief Breadth first search algorithm.
247 * @param [in] numberOfNodes total number of nodes
248 * @param [in] source Source Node
249 * @param [in] dest Destination Node
250 * @param [out] parentVector Parent vector for retracing routes
251 * @param [in] oif specific output interface to use from source node, if not null
252 * @returns false if dest not found, true o.w.
253 */
254 bool BFS(uint32_t numberOfNodes,
255 Ptr<Node> source,
256 Ptr<Node> dest,
257 std::vector<Ptr<Node>>& parentVector,
258 Ptr<NetDevice> oif) const;
259
260 /**
261 * \sa Ipv4RoutingProtocol::DoInitialize
262 * \sa Ipv6RoutingProtocol::DoInitialize
263 */
265
266 /**
267 * \sa Ipv4RoutingProtocol::DoDispose
268 * \sa Ipv6RoutingProtocol::DoDispose
269 */
270 void DoDispose();
271
272 /// Map of IpAddress to NixVector
273 typedef std::map<IpAddress, Ptr<NixVector>> NixMap_t;
274 /// Map of IpAddress to IpRoute
275 typedef std::map<IpAddress, Ptr<IpRoute>> IpRouteMap_t;
276
277 /// Callback for IPv4 unicast packets to be forwarded
280
281 /// Callback for IPv6 unicast packets to be forwarded
284
285 /// Callback for unicast packets to be forwarded
286 typedef typename std::conditional_t<IsIpv4, UnicastForwardCallbackv4, UnicastForwardCallbackv6>
288
289 /// Callback for IPv4 multicast packets to be forwarded
292
293 /// Callback for IPv6 multicast packets to be forwarded
294 typedef Callback<void,
298 const IpHeader&>
300
301 /// Callback for multicast packets to be forwarded
302 typedef
303 typename std::conditional_t<IsIpv4, MulticastForwardCallbackv4, MulticastForwardCallbackv6>
305
306 /// Callback for packets to be locally delivered
308
309 /// Callback for routing errors (e.g., no route found)
311
312 /* From Ipv4RoutingProtocol and Ipv6RoutingProtocol */
313 /**
314 * @brief Query routing cache for an existing route, for an outbound packet
315 * @param p packet to be routed. Note that this method may modify the packet.
316 * Callers may also pass in a null pointer.
317 * @param header input parameter (used to form key to search for the route)
318 * @param oif Output interface Netdevice. May be zero, or may be bound via
319 * socket options to a particular output interface.
320 * @param sockerr Output parameter; socket errno
321 *
322 * @returns a code that indicates what happened in the lookup
323 *
324 * \sa Ipv4RoutingProtocol::RouteOutput
325 * \sa Ipv6RoutingProtocol::RouteOutput
326 */
328 const IpHeader& header,
329 Ptr<NetDevice> oif,
330 Socket::SocketErrno& sockerr);
331
332 /**
333 * @brief Route an input packet (to be forwarded or locally delivered)
334 * @param p received packet
335 * @param header input parameter used to form a search key for a route
336 * @param idev Pointer to ingress network device
337 * @param ucb Callback for the case in which the packet is to be forwarded
338 * as unicast
339 * @param mcb Callback for the case in which the packet is to be forwarded
340 * as multicast
341 * @param lcb Callback for the case in which the packet is to be locally
342 * delivered
343 * @param ecb Callback to call if there is an error in forwarding
344 *
345 * @returns true if NixVectorRouting class takes responsibility for
346 * forwarding or delivering the packet, false otherwise
347 *
348 * \sa Ipv4RoutingProtocol::RouteInput
349 * \sa Ipv6RoutingProtocol::RouteInput
350 */
352 const IpHeader& header,
354 const UnicastForwardCallback& ucb,
355 const MulticastForwardCallback& mcb,
356 const LocalDeliverCallback& lcb,
357 const ErrorCallback& ecb);
358
359 /**
360 * @param interface the index of the interface we are being notified about
361 *
362 * \sa Ipv4RoutingProtocol::NotifyInterfaceUp
363 * \sa Ipv6RoutingProtocol::NotifyInterfaceUp
364 */
365 virtual void NotifyInterfaceUp(uint32_t interface);
366
367 /**
368 * @param interface the index of the interface we are being notified about
369 *
370 * \sa Ipv4RoutingProtocol::NotifyInterfaceDown
371 * \sa Ipv6RoutingProtocol::NotifyInterfaceDown
372 */
373 virtual void NotifyInterfaceDown(uint32_t interface);
374
375 /**
376 * @param interface the index of the interface we are being notified about
377 * @param address a new address being added to an interface
378 *
379 * \sa Ipv4RoutingProtocol::NotifyAddAddress
380 * \sa Ipv6RoutingProtocol::NotifyAddAddress
381 */
382 virtual void NotifyAddAddress(uint32_t interface, IpInterfaceAddress address);
383
384 /**
385 * @param interface the index of the interface we are being notified about
386 * @param address a new address being added to an interface
387 *
388 * \sa Ipv4RoutingProtocol::NotifyRemoveAddress
389 * \sa Ipv6RoutingProtocol::NotifyRemoveAddress
390 */
391 virtual void NotifyRemoveAddress(uint32_t interface, IpInterfaceAddress address);
392
393 /**
394 * @brief Print the Routing Table entries
395 *
396 * @param stream The ostream the Routing table is printed to
397 * @param unit The time unit to be used in the report
398 *
399 * \sa Ipv4RoutingProtocol::PrintRoutingTable
400 * \sa Ipv6RoutingProtocol::PrintRoutingTable
401 */
403 Time::Unit unit = Time::S) const;
404
405 /* From IPv4RoutingProtocol */
406 /**
407 * @brief Typically, invoked directly or indirectly from ns3::Ipv4::SetRoutingProtocol
408 *
409 * @param ipv4 the ipv4 object this routing protocol is being associated with
410 *
411 * \sa Ipv4RoutingProtocol::SetIpv4
412 */
413 virtual void SetIpv4(Ptr<Ip> ipv4);
414
415 /* From IPv6RoutingProtocol */
416 /**
417 * @brief Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol
418 *
419 * @param ipv6 the ipv6 object this routing protocol is being associated with
420 *
421 * \sa Ipv6RoutingProtocol::SetIpv6
422 */
423 virtual void SetIpv6(Ptr<Ip> ipv6);
424
425 /**
426 * @brief Notify a new route.
427 *
428 * @param dst destination address
429 * @param mask destination mask
430 * @param nextHop nextHop for this destination
431 * @param interface output interface
432 * @param prefixToUse prefix to use as source with this route
433 *
434 * \sa Ipv6RoutingProtocol::NotifyAddRoute
435 */
436 virtual void NotifyAddRoute(IpAddress dst,
437 Ipv6Prefix mask,
438 IpAddress nextHop,
439 uint32_t interface,
440 IpAddress prefixToUse = IpAddress::GetZero());
441
442 /**
443 * @brief Notify route removing.
444 *
445 * @param dst destination address
446 * @param mask destination mask
447 * @param nextHop nextHop for this destination
448 * @param interface output interface
449 * @param prefixToUse prefix to use as source with this route
450 *
451 * \sa Ipv6RoutingProtocol::NotifyRemoveRoute
452 */
453 virtual void NotifyRemoveRoute(IpAddress dst,
454 Ipv6Prefix mask,
455 IpAddress nextHop,
456 uint32_t interface,
457 IpAddress prefixToUse = IpAddress::GetZero());
458
459 /**
460 * Flushes routing caches if required.
461 */
463
464 /**
465 * Build map from IP Address to Node for faster lookup.
466 */
468
469 /**
470 * Flag to mark when caches are dirty and need to be flushed.
471 * Used for lazy cleanup of caches when there are many topology changes.
472 */
473 static bool g_isCacheDirty;
474
475 /**
476 * Nix Epoch, incremented each time a flush is performed.
477 */
479
480 /** Cache stores nix-vectors based on destination ip */
482
483 /** Cache stores IpRoutes based on destination ip */
485
486 Ptr<Ip> m_ip; //!< IP object
487 Ptr<Node> m_node; //!< Node object
488
489 /** Total neighbors used for nix-vector to determine number of bits */
491
492 /**
493 * Mapping of IP address to ns-3 node.
494 *
495 * Used to avoid linear searching of nodes/devices to find a node in
496 * GetNodeByIp() method. NIX vector routing assumes IP addresses
497 * are unique so mapping can be done without duplication.
498 **/
499 typedef std::unordered_map<IpAddress, ns3::Ptr<ns3::Node>> IpAddressToNodeMap;
500 static IpAddressToNodeMap g_ipAddressToNodeMap; //!< Address to node map.
501
502 /// Mapping of Ptr<NetDevice> to Ptr<IpInterface>.
503 typedef std::unordered_map<Ptr<NetDevice>, Ptr<IpInterface>> NetDeviceToIpInterfaceMap;
505 g_netdeviceToIpInterfaceMap; //!< NetDevice pointer to IpInterface pointer map
506};
507
508/**
509 * @ingroup nix-vector-routing
510 * Create the typedef Ipv4NixVectorRouting with T as Ipv4RoutingProtocol
511 *
512 * Note: This typedef enables also backwards compatibility with original Ipv4NixVectorRouting.
513 */
515
516/**
517 * @ingroup nix-vector-routing
518 * Create the typedef Ipv6NixVectorRouting with T as Ipv6RoutingProtocol
519 */
521} // namespace ns3
522
523// NOLINTEND(modernize-use-override)
524
525#endif /* NIX_VECTOR_ROUTING_H */
Callback template class.
Definition callback.h:428
Describes an IPv6 prefix.
holds a vector of ns3::NetDevice pointers
Nix-vector routing protocol.
Callback< void, Ptr< IpRoute >, Ptr< const Packet >, const IpHeader & > UnicastForwardCallbackv4
Callback for IPv4 unicast packets to be forwarded.
std::map< IpAddress, Ptr< IpRoute > > IpRouteMap_t
Map of IpAddress to IpRoute.
void PrintRoutingPath(Ptr< Node > source, IpAddress dest, Ptr< OutputStreamWrapper > stream, Time::Unit unit) const
Print the Routing Path according to Nix Routing.
void BuildIpAddressToNodeMap() const
Build map from IP Address to Node for faster lookup.
typename std::conditional_t< IsIpv4, Ipv4InterfaceAddress, Ipv6InterfaceAddress > IpInterfaceAddress
Alias for Ipv4InterfaceAddress and Ipv6InterfaceAddress classes.
Ptr< IpRoute > GetIpRouteInCache(IpAddress address)
Checks the cache based on dest IP for the IpRoute.
virtual void NotifyRemoveRoute(IpAddress dst, Ipv6Prefix mask, IpAddress nextHop, uint32_t interface, IpAddress prefixToUse=IpAddress::GetZero())
Notify route removing.
virtual void NotifyAddRoute(IpAddress dst, Ipv6Prefix mask, IpAddress nextHop, uint32_t interface, IpAddress prefixToUse=IpAddress::GetZero())
Notify a new route.
bool BFS(uint32_t numberOfNodes, Ptr< Node > source, Ptr< Node > dest, std::vector< Ptr< Node > > &parentVector, Ptr< NetDevice > oif) const
Breadth first search algorithm.
virtual void NotifyInterfaceUp(uint32_t interface)
void GetAdjacentNetDevices(Ptr< NetDevice > netDevice, Ptr< Channel > channel, NetDeviceContainer &netDeviceContainer) const
Given a net-device returns all the adjacent net-devices, essentially getting the neighbors on that ch...
std::conditional_t< IsIpv4, UnicastForwardCallbackv4, UnicastForwardCallbackv6 > UnicastForwardCallback
Callback for unicast packets to be forwarded.
std::map< IpAddress, Ptr< NixVector > > NixMap_t
Map of IpAddress to NixVector.
typename std::conditional_t< IsIpv4, Ipv4Route, Ipv6Route > IpRoute
Alias for Ipv4Route and Ipv6Route classes.
virtual void NotifyInterfaceDown(uint32_t interface)
typename std::conditional_t< IsIpv4, Ipv4Address, Ipv6Address > IpAddress
Alias for Ipv4Address and Ipv6Address classes.
void FlushGlobalNixRoutingCache() const
Called when run-time link topology change occurs which iterates through the node list and flushes any...
Callback< void, Ptr< Ipv4MulticastRoute >, Ptr< const Packet >, const IpHeader & > MulticastForwardCallbackv4
Callback for IPv4 multicast packets to be forwarded.
virtual void SetIpv6(Ptr< Ip > ipv6)
Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol.
Callback< void, Ptr< const Packet >, const IpHeader &, Socket::SocketErrno > ErrorCallback
Callback for routing errors (e.g., no route found).
virtual Ptr< IpRoute > RouteOutput(Ptr< Packet > p, const IpHeader &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr)
Query routing cache for an existing route, for an outbound packet.
virtual void SetIpv4(Ptr< Ip > ipv4)
Typically, invoked directly or indirectly from ns3::Ipv4::SetRoutingProtocol.
Ptr< IpInterface > GetInterfaceByNetDevice(Ptr< NetDevice > netDevice) const
Iterates through the node list and finds the one corresponding to the given IpAddress.
uint32_t FindTotalNeighbors(Ptr< Node > node) const
Simply iterates through the nodes net-devices and determines how many neighbors the node has.
virtual void NotifyAddAddress(uint32_t interface, IpInterfaceAddress address)
std::conditional_t< IsIpv4, MulticastForwardCallbackv4, MulticastForwardCallbackv6 > MulticastForwardCallback
Callback for multicast packets to be forwarded.
void FlushIpRouteCache() const
Flushes the cache which stores the Ip route based on the destination IP.
virtual bool RouteInput(Ptr< const Packet > p, const IpHeader &header, Ptr< const NetDevice > idev, const UnicastForwardCallback &ucb, const MulticastForwardCallback &mcb, const LocalDeliverCallback &lcb, const ErrorCallback &ecb)
Route an input packet (to be forwarded or locally delivered).
Ptr< NixVector > GetNixVector(Ptr< Node > source, IpAddress dest, Ptr< NetDevice > oif) const
Takes in the source node and dest IP and calls GetNodeByIp, BFS, accounting for any output interface ...
typename std::conditional_t< IsIpv4, Ipv4Interface, Ipv6Interface > IpInterface
Alias for Ipv4Interface and Ipv6Interface classes.
typename std::conditional_t< IsIpv4, Ipv4, Ipv6 > Ip
Alias for Ipv4 and Ipv6 classes.
typename std::conditional_t< IsIpv4, Ipv4Header, Ipv6Header > IpHeader
Alias for Ipv4Header and Ipv6Header classes.
bool BuildNixVector(const std::vector< Ptr< Node > > &parentVector, uint32_t source, uint32_t dest, Ptr< NixVector > nixVector) const
Recurses the T vector, created by BFS and actually builds the nixvector.
Callback< void, Ptr< const NetDevice >, Ptr< Ipv6MulticastRoute >, Ptr< const Packet >, const IpHeader & > MulticastForwardCallbackv6
Callback for IPv6 multicast packets to be forwarded.
Ptr< NixVector > GetNixVectorInCache(const IpAddress &address, bool &foundInCache) const
Checks the cache based on dest IP for the nix-vector.
uint32_t FindNetDeviceForNixIndex(Ptr< Node > node, uint32_t nodeIndex, IpAddress &gatewayIp) const
Nix index is with respect to the neighbors.
void SetNode(Ptr< Node > node)
Set the Node pointer of the node for which this routing protocol is to be placed.
virtual void PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const
Print the Routing Table entries.
typename std::conditional_t< IsIpv4, Ipv4L3Protocol, Ipv6L3Protocol > IpL3Protocol
Alias for Ipv4L3Protocol and Ipv4L3Protocol classes.
void ResetTotalNeighbors()
Upon a run-time topology change caches are flushed and the total number of neighbors is reset to zero...
virtual void NotifyRemoveAddress(uint32_t interface, IpInterfaceAddress address)
Callback< void, Ptr< const Packet >, const IpHeader &, uint32_t > LocalDeliverCallback
Callback for packets to be locally delivered.
static TypeId GetTypeId()
The Interface ID of the Global Router interface.
std::unordered_map< IpAddress, ns3::Ptr< ns3::Node > > IpAddressToNodeMap
Mapping of IP address to ns-3 node.
void CheckCacheStateAndFlush() const
Flushes routing caches if required.
Callback< void, Ptr< const NetDevice >, Ptr< IpRoute >, Ptr< const Packet >, const IpHeader & > UnicastForwardCallbackv6
Callback for IPv6 unicast packets to be forwarded.
std::unordered_map< Ptr< NetDevice >, Ptr< IpInterface > > NetDeviceToIpInterfaceMap
Mapping of Ptr<NetDevice> to Ptr<IpInterface>.
Ptr< BridgeNetDevice > NetDeviceIsBridged(Ptr< NetDevice > nd) const
Determine if the NetDevice is bridged.
static NetDeviceToIpInterfaceMap g_netdeviceToIpInterfaceMap
void FlushNixCache() const
Flushes the cache which stores nix-vector based on destination IP.
Ptr< Node > GetNodeByIp(IpAddress dest) const
Iterates through the node list and finds the one corresponding to the given IpAddress.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
SocketErrno
Enumeration of the possible errors returned by a socket.
Definition socket.h:73
Unit
The unit to use to interpret a number representing time.
Definition nstime.h:102
@ S
second
Definition nstime.h:107
a unique identifier for an interface.
Definition type-id.h:49
NixVectorRouting< Ipv6RoutingProtocol > Ipv6NixVectorRouting
Create the typedef Ipv6NixVectorRouting with T as Ipv6RoutingProtocol.
NixVectorRouting< Ipv4RoutingProtocol > Ipv4NixVectorRouting
Create the typedef Ipv4NixVectorRouting with T as Ipv4RoutingProtocol.
Every class exported by the ns3 library is enclosed in the ns3 namespace.