|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
24 #include "ns3/abort.h"
25 #include "ns3/assert.h"
26 #include "ns3/unused.h"
27 #include "ns3/random-variable-stream.h"
28 #include "ns3/ipv6-route.h"
30 #include "ns3/names.h"
31 #include "ns3/ripng-header.h"
32 #include "ns3/udp-header.h"
34 #include "ns3/uinteger.h"
35 #include "ns3/ipv6-packet-info-tag.h"
36 #include "ns3/simulator.h"
38 #define RIPNG_ALL_NODE "ff02::9"
39 #define RIPNG_PORT 521
48 : m_ipv6 (0), m_splitHorizonStrategy (
RipNg::POISON_REVERSE), m_initialized (false)
50 m_rng = CreateObject<UniformRandomVariable> ();
62 .SetGroupName (
"Internet")
63 .AddConstructor<
RipNg> ()
64 .AddAttribute (
"UnsolicitedRoutingUpdate",
"The time between two Unsolicited Routing Updates.",
68 .AddAttribute (
"StartupDelay",
"Maximum random delay for protocol startup (send route requests).",
72 .AddAttribute (
"TimeoutDelay",
"The delay to invalidate a route.",
76 .AddAttribute (
"GarbageCollectionDelay",
"The delay to delete an expired route.",
80 .AddAttribute (
"MinTriggeredCooldown",
"Min cooldown delay after a Triggered Update.",
84 .AddAttribute (
"MaxTriggeredCooldown",
"Max cooldown delay after a Triggered Update.",
88 .AddAttribute (
"SplitHorizon",
"Split Horizon strategy.",
94 .AddAttribute (
"LinkDownValue",
"Value for link down in count to infinity.",
97 MakeUintegerChecker<uint8_t> ())
114 bool addedGlobal =
false;
122 for (uint32_t i = 0 ; i <
m_ipv6->GetNInterfaces (); i++)
124 bool activeInterface =
false;
127 activeInterface =
true;
128 m_ipv6->SetForwarding (i,
true);
131 for (uint32_t j = 0; j <
m_ipv6->GetNAddresses (i); j++)
142 int ret = socket->
Bind (local);
200 rtentry =
Lookup (destination, oif);
221 uint32_t iif =
m_ipv6->GetInterfaceForDevice (idev);
226 NS_LOG_LOGIC (
"Multicast route not supported by RIPng");
233 NS_LOG_LOGIC (
"Dropping packet not for me and with src or dst LinkLocal");
242 if (
m_ipv6->IsForwarding (iif) ==
false)
244 NS_LOG_LOGIC (
"Forwarding disabled for this interface");
257 NS_LOG_LOGIC (
"Found unicast destination - calling unicast callback");
258 ucb (idev, rtentry, p, header);
263 NS_LOG_LOGIC (
"Did not find unicast destination - returning false");
272 for (uint32_t j = 0; j <
m_ipv6->GetNAddresses (i); j++)
290 bool sendSocketFound =
false;
293 if (iter->second == i)
295 sendSocketFound =
true;
300 bool activeInterface =
false;
303 activeInterface =
true;
304 m_ipv6->SetForwarding (i,
true);
307 for (uint32_t j = 0; j <
m_ipv6->GetNAddresses (i); j++)
319 socket->
Bind (local);
352 if (it->first->GetInterface () == interface)
360 NS_LOG_INFO (
"Checking socket for interface " << interface);
361 if (iter->second == interface)
363 NS_LOG_INFO (
"Removed socket for interface " << interface);
364 iter->first->Close ();
380 if (!
m_ipv6->IsUp (interface))
405 if (!
m_ipv6->IsUp (interface))
422 if (it->first->GetInterface () == interface
423 && it->first->IsNetwork ()
424 && it->first->GetDestNetwork () == networkAddress
425 && it->first->GetDestNetworkPrefix () == networkMask)
440 NS_LOG_INFO (
this << dst << mask << nextHop << interface << prefixToUse);
458 for (i = 0; i <
m_ipv6->GetNInterfaces (); i++)
476 *os << std::resetiosflags (std::ios::adjustfield) << std::setiosflags (std::ios::left);
478 *os <<
"Node: " <<
m_ipv6->GetObject<
Node> ()->GetId ()
479 <<
", Time: " <<
Now().
As (unit)
480 <<
", Local time: " <<
m_ipv6->GetObject<
Node> ()->GetLocalTime ().As (unit)
481 <<
", IPv6 RIPng table" << std::endl;
485 *os <<
"Destination Next Hop Flag Met Ref Use If" << std::endl;
493 std::ostringstream dest, gw, mask, flags;
496 *os << std::setw (31) << dest.str ();
498 *os << std::setw (27) << gw.str ();
508 *os << std::setw (5) << flags.str ();
546 iter->first->Close ();
564 uint16_t longestMask = 0;
569 NS_ASSERT_MSG (interface,
"Try to send on link-local multicast address, and no interface index is given!");
570 rtentry = Create<Ipv6Route> ();
571 rtentry->SetSource (
m_ipv6->SourceAddressSelection (
m_ipv6->GetInterfaceForDevice (interface), dst));
572 rtentry->SetDestination (dst);
574 rtentry->SetOutputDevice (interface);
588 NS_LOG_LOGIC (
"Searching for route to " << dst <<
", mask length " << maskLen);
592 NS_LOG_LOGIC (
"Found global network route " << j <<
", mask length " << maskLen);
597 if (maskLen < longestMask)
603 longestMask = maskLen;
607 rtentry = Create<Ipv6Route> ();
611 rtentry->SetSource (
m_ipv6->SourceAddressSelection (interfaceIdx, route->
GetDest ()));
619 rtentry->SetSource (
m_ipv6->SourceAddressSelection (interfaceIdx, route->
GetDest ()));
622 rtentry->SetDestination (route->
GetDest ());
624 rtentry->SetOutputDevice (
m_ipv6->GetNetDevice (interfaceIdx));
632 NS_LOG_LOGIC (
"Matching route via " << rtentry->GetDestination () <<
" (through " << rtentry->GetGateway () <<
") at the end");
639 NS_LOG_FUNCTION (
this << network << networkPrefix << nextHop << interface << prefixToUse);
643 NS_LOG_WARN (
"Ripng::AddNetworkRouteTo - Next hop should be link-local");
672 if (it->first == route)
677 if (it->second.IsRunning ())
679 it->second.Cancel ();
685 NS_ABORT_MSG (
"Ripng::InvalidateRoute - cannot find the route to update");
694 if (it->first == route)
701 NS_ABORT_MSG (
"Ripng::DeleteRoute - cannot find the route to delete");
712 NS_LOG_INFO (
"Received " << *packet <<
" from " << senderAddr);
715 uint16_t senderPort = senderAddr.
GetPort ();
720 NS_ABORT_MSG (
"No incoming interface on RIPng message, aborting.");
722 uint32_t incomingIf = interfaceInfo.
GetRecvIf ();
723 Ptr<Node> node = this->GetObject<Node> ();
725 uint32_t ipInterfaceIndex =
m_ipv6->GetInterfaceForDevice (dev);
730 NS_ABORT_MSG (
"No incoming Hop Count on RIPng message, aborting.");
734 int32_t interfaceForAddress =
m_ipv6->GetInterfaceForAddress (senderAddress);
735 if (interfaceForAddress != -1)
750 HandleRequests (hdr, senderAddress, senderPort, ipInterfaceIndex, hopLimit);
761 NS_LOG_FUNCTION (
this << senderAddress <<
int (senderPort) << incomingInterface <<
int (hopLimit) << requestHdr);
763 std::list<RipNgRte> rtes = requestHdr.
GetRteList ();
771 if (rtes.size () == 1 && senderAddress.
IsLinkLocal ())
774 rtes.begin ()->GetPrefixLen () == 0 &&
775 rtes.begin ()->GetRouteMetric () ==
m_linkDown)
785 if (iter->second == incomingInterface)
787 sendingSocket = iter->first;
790 NS_ASSERT_MSG (sendingSocket,
"HandleRequest - Impossible to find a socket to send the reply");
792 uint16_t mtu =
m_ipv6->GetMtu (incomingInterface);
806 bool splitHorizoning = (rtIter->first->GetInterface () == incomingInterface);
813 (rtIter->first->GetInterface () != incomingInterface));
815 if ((isGlobal || isDefaultRoute) &&
819 rte.
SetPrefix (rtIter->first->GetDestNetwork ());
820 rte.
SetPrefixLen (rtIter->first->GetDestNetworkPrefix ().GetPrefixLength ());
865 if (iter->second == incomingInterface)
867 sendingSocket = iter->first;
885 for (std::list<RipNgRte>::iterator iter = rtes.begin ();
886 iter != rtes.end (); iter++)
897 Ipv6Address rtAddress = rtIter->first->GetDestNetwork ();
898 rtAddress.
CombinePrefix (rtIter->first->GetDestNetworkPrefix ());
900 if (requestedAddress == rtAddress)
902 iter->SetRouteMetric (rtIter->first->GetRouteMetric ());
903 iter->SetRouteTag (rtIter->first->GetRouteTag ());
913 iter->SetRouteTag (0);
926 NS_LOG_FUNCTION (
this << senderAddress << incomingInterface <<
int (hopLimit) << hdr);
930 NS_LOG_LOGIC (
"Ignoring an update message from an excluded interface: " << incomingInterface);
936 NS_LOG_LOGIC (
"Ignoring an update message from a non-link-local source: " << senderAddress);
942 NS_LOG_LOGIC (
"Ignoring an update message with suspicious hop count: " <<
int (hopLimit));
949 for (std::list<RipNgRte>::iterator iter = rtes.begin ();
950 iter != rtes.end (); iter++)
952 if (iter->GetRouteMetric () == 0 || iter->GetRouteMetric () >
m_linkDown)
954 NS_LOG_LOGIC (
"Ignoring an update message with malformed metric: " <<
int (iter->GetRouteMetric ()));
957 if (iter->GetPrefixLen () > 128)
959 NS_LOG_LOGIC (
"Ignoring an update message with malformed prefix length: " <<
int (iter->GetPrefixLen ()));
962 if (iter->GetPrefix ().IsLocalhost () ||
963 iter->GetPrefix ().IsLinkLocal () ||
964 iter->GetPrefix ().IsMulticast ())
966 NS_LOG_LOGIC (
"Ignoring an update message with wrong prefixes: " << iter->GetPrefix ());
971 bool changed =
false;
973 for (std::list<RipNgRte>::iterator iter = rtes.begin ();
974 iter != rtes.end (); iter++)
981 uint8_t interfaceMetric = 1;
986 uint16_t rteMetric = iter->GetRouteMetric () + interfaceMetric;
995 if (it->first->GetDestNetwork () == rteAddr &&
996 it->first->GetDestNetworkPrefix () == rtePrefix)
999 if (rteMetric < it->
first->GetRouteMetric ())
1001 if (senderAddress != it->first->GetGateway ())
1009 it->first->SetRouteTag (iter->GetRouteTag ());
1010 it->first->SetRouteChanged (
true);
1011 it->second.Cancel ();
1015 else if (rteMetric == it->first->GetRouteMetric ())
1017 if (senderAddress == it->first->GetGateway ())
1019 it->second.Cancel ();
1033 it->second.Cancel ();
1039 else if (rteMetric > it->first->GetRouteMetric () && senderAddress == it->first->GetGateway ())
1041 it->second.Cancel ();
1044 it->first->SetRouteMetric (rteMetric);
1046 it->first->SetRouteTag (iter->GetRouteTag ());
1047 it->first->SetRouteChanged (
true);
1048 it->second.Cancel ();
1061 NS_LOG_LOGIC (
"Received a RTE with new route, adding.");
1086 uint32_t
interface = iter->
second;
1090 uint16_t mtu =
m_ipv6->GetMtu (interface);
1103 bool splitHorizoning = (rtIter->first->GetInterface () == interface);
1106 NS_LOG_DEBUG (
"Processing RT " << rtDestAddr <<
" " <<
int(rtIter->first->IsRouteChanged ()));
1111 (rtIter->first->GetInterface () != interface));
1113 if ((isGlobal || isDefaultRoute) &&
1114 (periodic || rtIter->first->IsRouteChanged ()))
1117 rte.
SetPrefix (rtIter->first->GetDestNetwork ());
1118 rte.
SetPrefixLen (rtIter->first->GetDestNetworkPrefix ().GetPrefixLength ());
1156 rtIter->first->SetRouteChanged (
false);
1166 NS_LOG_LOGIC (
"Skipping Triggered Update due to cooldown");
1221 std::map<uint32_t, uint8_t>::const_iterator iter =
m_interfaceMetrics.find (interface);
1224 return iter->second;
1262 uint32_t
interface = iter->
second;
1285 : m_tag (0), m_metric (0), m_status (RIPNG_INVALID), m_changed (false)
1291 m_tag (0), m_metric (0), m_status (RIPNG_INVALID), m_changed (false)
1297 m_tag (0), m_metric (0), m_status (RIPNG_INVALID), m_changed (false)
1308 if (
m_tag != routeTag)
1361 os << static_cast<const Ipv6RoutingTableEntry &>(rte);
Time m_minTriggeredUpdateDelay
Min cooldown delay after a Triggered Update.
a unique identifier for an interface.
bool IsMatch(Ipv6Address a, Ipv6Address b) const
If the Address match the type.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time m_maxTriggeredUpdateDelay
Max cooldown delay after a Triggered Update.
virtual void NotifyAddAddress(uint32_t interface, Ipv6InterfaceAddress address)
Notify when specified interface add an address.
IPv6 address associated with an interface.
uint32_t GetRecvIf(void) const
Get the tag's receiving interface.
void SetRouteMetric(uint8_t routeMetric)
Set the route metric.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
uint8_t GetRouteMetric(void) const
Get the route metric.
uint8_t m_metric
route metric
Status_e m_status
route status
bool m_changed
route has been updated
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
Routes m_routes
the forwarding table for network.
void SendTriggeredRouteUpdate()
Send Triggered Routing Updates on all interfaces.
An identifier for simulation events.
bool m_initialized
flag to allow socket's late-creation.
void AddHeader(const Header &header)
Add header to this packet.
SocketErrno
Enumeration of the possible errors returned by a socket.
Time m_unsolicitedUpdate
time between two Unsolicited Routing Updates
void DoInitialize()
Start protocol operation.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool IsNull(void) const
Check for null implementation.
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
void HandleRequests(RipNgHeader hdr, Ipv6Address senderAddress, uint16_t senderPort, uint32_t incomingInterface, uint8_t hopLimit)
Handle RIPng requests.
static Time GetDelayLeft(const EventId &id)
Get the remaining time until this event will execute.
void SetRecvPktInfo(bool flag)
Enable/Disable receive packet information to socket.
Ipv6Address GetPrefixToUse() const
Get the prefix to use (for multihomed link).
Ptr< Socket > m_multicastRecvSocket
multicast receive socket
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
virtual void NotifyAddRoute(Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address::GetZero())
Notify a new route.
@ POISON_REVERSE
Poison Reverse Split Horizon.
Describes an IPv6 address.
std::ostream * GetStream(void)
Return a pointer to an ostream previously set in the wrapper.
void SetRouteTag(uint16_t routeTag)
Set the route tag.
@ LINKLOCAL
Link-local address (fe80::/64)
std::map< Ptr< Socket >, uint32_t >::iterator SocketListI
Socket list type iterator.
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
@ NO_SPLIT_HORIZON
No Split Horizon.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
A record of an IPv6 route.
virtual int SendTo(Ptr< Packet > p, uint32_t flags, const Address &toAddress)=0
Send data to a specified peer.
virtual void NotifyInterfaceUp(uint32_t interface)
Notify when specified interface goes UP.
Status_e GetRouteStatus(void) const
Get the route status.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold variables of type enum.
uint16_t GetPort(void) const
Get the port.
void SetRouteStatus(Status_e status)
Set the route status.
Ipv6Address GetGateway() const
Get the gateway.
void SendUnsolicitedRouteUpdate(void)
Send Unsolicited Routing Updates on all interfaces.
virtual void NotifyRemoveAddress(uint32_t interface, Ipv6InterfaceAddress address)
Notify when specified interface add an address.
static Inet6SocketAddress ConvertFrom(const Address &addr)
Convert the address to a InetSocketAddress.
RipNg Routing Table Entry (RTE) - see RFC 2080
std::list< std::pair< RipNgRoutingTableEntry *, EventId > >::iterator RoutesI
Iterator for container for the network routes.
uint8_t GetHopLimit(void) const
Get the tag's Hop Limit.
bool IsLinkLocal() const
If the IPv6 address is a link-local address (fe80::/64).
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
void SetRecvCallback(Callback< void, Ptr< Socket > > receivedData)
Notify application when new data is available to be read.
Ipv6Address CombinePrefix(Ipv6Prefix const &prefix) const
Combine this address with a prefix.
This class implements a tag that carries socket ancillary data to the socket interface.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
a polymophic address class
virtual void NotifyRemoveRoute(Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address::GetZero())
Notify route removing.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
virtual Ptr< Packet > RecvFrom(uint32_t maxSize, uint32_t flags, Address &fromAddress)=0
Read a single packet from the socket and retrieve the sender address.
static std::string FindName(Ptr< Object > object)
Given a pointer to an object, look to see if that object has a name associated with it and,...
void SendRouteRequest()
Send Routing Request on all interfaces.
This class implements a tag that carries the socket-specific HOPLIMIT of a packet to the IPv6 layer.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
uint8_t m_linkDown
Link down value.
static Ipv6Prefix GetZero()
Get the zero prefix ( /0).
Abstract base class for IPv6 routing protocols.
void AddNetworkRouteTo(Ipv6Address network, Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse)
Add route to network.
Simulation virtual time values and global simulation resolution.
virtual int Close(void)=0
Close a socket.
Ptr< Ipv6Route > Lookup(Ipv6Address dest, Ptr< NetDevice >=0)
Lookup in the forwarding table for destination.
Ipv6Prefix GetDestNetworkPrefix() const
Get the destination prefix.
Ipv6Address GetDestNetwork() const
Get the destination network.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Time m_startupDelay
Random delay before protocol startup.
virtual void DoInitialize(void)
Initialize() implementation.
void SetRouteMetric(uint8_t routeMetric)
Set the route metric.
SplitHorizonType_e m_splitHorizonStrategy
Split Horizon strategy.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
RipNgRoutingTableEntry(void)
static Ipv6Address GetZero()
Get the 0 (::) Ipv6Address.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
void SetRouteChanged(bool changed)
Set the route as changed.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Ipv6Address GetIpv6(void) const
Get the IPv6 address.
bool IsRouteChanged(void) const
Get the route changed status.
void SetIpv6RecvHopLimit(bool ipv6RecvHopLimit)
Tells a socket to pass information about IPv6 Hop Limit up the stack.
bool IsLinkLocalMulticast() const
If the IPv6 address is link-local multicast (ff02::/16).
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Ipv6InterfaceAddress::Scope_e GetScope() const
Get address scope.
std::set< uint32_t > m_interfaceExclusions
Set of excluded interfaces.
bool IsMulticast() const
If the IPv6 address is multicast (ff00::/8).
std::set< uint32_t > GetInterfaceExclusions() const
Get the set of interface excluded from the protocol.
void DeleteRoute(RipNgRoutingTableEntry *route)
Delete a route.
void Receive(Ptr< Socket > socket)
Receive RIPng packets.
void SetPrefixLen(uint8_t prefixLen)
Set the prefix length.
RipNg Routing Table Entry.
@ SPLIT_HORIZON
Split Horizon.
virtual void DoDispose()
Dispose this object.
EventId m_nextTriggeredUpdate
Next Triggered Update event.
uint16_t GetRouteTag(void) const
Get the route tag.
void AddDefaultRouteTo(Ipv6Address nextHop, uint32_t interface)
Add a default route to the router through the nextHop located on interface.
Ipv6Address GetDest() const
Get the destination.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Time m_garbageCollectionDelay
Delay before deleting an INVALID route.
std::list< std::pair< RipNgRoutingTableEntry *, EventId > >::const_iterator RoutesCI
Const Iterator for container for the network routes.
void InvalidateRoute(RipNgRoutingTableEntry *route)
Invalidate a route.
Time Seconds(double value)
Construct a Time in the indicated unit.
void SetPrefix(Ipv6Address prefix)
Set the prefix.
EventId m_nextUnsolicitedUpdate
Next Unsolicited Update event.
uint8_t GetPrefixLength() const
Get prefix length.
bool RouteInput(Ptr< const Packet > p, const Ipv6Header &header, Ptr< const NetDevice > idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb)
Route an input packet (to be forwarded or locally delivered)
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
static Ipv6Address GetAny()
Get the "any" (::) Ipv6Address.
Ptr< Ipv6 > m_ipv6
IPv6 reference.
virtual void BindToNetDevice(Ptr< NetDevice > netdevice)
Bind a socket to specific device.
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
void SetRouteTag(uint16_t routeTag)
Set the route tag.
AttributeValue implementation for Time.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
uint32_t GetInterface() const
Get the interface index.
virtual void NotifyInterfaceDown(uint32_t interface)
Notify when specified interface goes DOWN.
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
Hold an unsigned integer type.
void DoSendRouteUpdate(bool periodic)
Send Routing Updates on all interfaces.
static Ptr< Socket > CreateSocket(Ptr< Node > node, TypeId tid)
This method wraps the creation of sockets that is performed on a given node by a SocketFactory specif...
RIPng Routing Protocol, defined in RFC 2080.
@ GLOBAL
Global address (2000::/3)
bool IsGateway() const
Is it the gateway ?
virtual ~RipNgRoutingTableEntry()
void SetInterfaceMetric(uint32_t interface, uint8_t metric)
Set the metric for an interface.
Ptr< Ipv6Route > RouteOutput(Ptr< Packet > p, const Ipv6Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr)
Query routing cache for an existing route, for an outbound packet.
virtual void PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const
Print the Routing Table entries.
void SetInterfaceExclusions(std::set< uint32_t > exceptions)
Set the set of interface excluded from the protocol.
static TypeId GetTypeId(void)
Get the type ID.
bool IsAny() const
If the IPv6 address is the "Any" address.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
std::map< uint32_t, uint8_t > m_interfaceMetrics
Map of interface metrics.
std::ostream & operator<<(std::ostream &os, const Angles &a)
virtual void SetIpv6(Ptr< Ipv6 > ipv6)
Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol.
Describes an IPv6 prefix.
static TypeId LookupByName(std::string name)
Get a TypeId by name.
void HandleResponses(RipNgHeader hdr, Ipv6Address senderAddress, uint32_t incomingInterface, uint8_t hopLimit)
Handle RIPng responses.
virtual void DoDispose(void)
Destructor implementation.
bool IsHost() const
Is the route entry correspond to a host ?
void SetHopLimit(uint8_t hopLimit)
Set the tag's Hop Limit.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Unit
The unit to use to interpret a number representing time.
Time m_timeoutDelay
Delay before invalidating a route.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< UniformRandomVariable > m_rng
Rng stream.
SocketList m_unicastSocketList
list of sockets for unicast messages (socket, interface index)
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
uint8_t GetInterfaceMetric(uint32_t interface) const
Get the metric for an interface.