29 #include "ns3/inet6-socket-address.h"
30 #include "ns3/random-variable-stream.h"
290 typedef std::list<std::pair<RipNgRoutingTableEntry*, EventId>>
Routes;
293 typedef std::list<std::pair<RipNgRoutingTableEntry*, EventId>>::const_iterator
RoutesCI;
296 typedef std::list<std::pair<RipNgRoutingTableEntry*, EventId>>::iterator
RoutesI;
317 uint32_t incomingInterface,
330 uint32_t incomingInterface,
An identifier for simulation events.
Describes an IPv6 address.
static Ipv6Address GetZero()
Get the 0 (::) Ipv6Address.
IPv6 address associated with an interface.
Describes an IPv6 prefix.
Abstract base class for IPv6 routing protocols.
A record of an IPv6 route.
Smart pointer class similar to boost::intrusive_ptr.
RIPng Routing Protocol, defined in RFC 2080.
Ptr< Socket > m_multicastRecvSocket
multicast receive socket
void NotifyInterfaceUp(uint32_t interface) override
Notify when specified interface goes UP.
void NotifyAddAddress(uint32_t interface, Ipv6InterfaceAddress address) override
Notify when specified interface add an address.
void NotifyAddRoute(Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address::GetZero()) override
Notify a new route.
void DoSendRouteUpdate(bool periodic)
Send Routing Updates on all interfaces.
Time m_startupDelay
Random delay before protocol startup.
void DoDispose() override
Dispose this object.
std::list< std::pair< RipNgRoutingTableEntry *, EventId > >::const_iterator RoutesCI
Const Iterator for container for the network routes.
SplitHorizonType_e m_splitHorizonStrategy
Split Horizon strategy.
SplitHorizonType_e
Split Horizon strategy type.
@ SPLIT_HORIZON
Split Horizon.
@ POISON_REVERSE
Poison Reverse Split Horizon.
@ NO_SPLIT_HORIZON
No Split Horizon.
EventId m_nextTriggeredUpdate
Next Triggered Update event.
void NotifyRemoveAddress(uint32_t interface, Ipv6InterfaceAddress address) override
Notify when specified interface add an address.
Time m_minTriggeredUpdateDelay
Min cooldown delay after a Triggered Update.
void SetInterfaceExclusions(std::set< uint32_t > exceptions)
Set the set of interface excluded from the protocol.
Ptr< Ipv6Route > RouteOutput(Ptr< Packet > p, const Ipv6Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr) override
Query routing cache for an existing route, for an outbound packet.
std::map< Ptr< Socket >, uint32_t >::iterator SocketListI
Socket list type iterator.
EventId m_nextUnsolicitedUpdate
Next Unsolicited Update event.
uint8_t m_linkDown
Link down value.
Time m_maxTriggeredUpdateDelay
Max cooldown delay after a Triggered Update.
void DoInitialize() override
Start protocol operation.
bool m_initialized
flag to allow socket's late-creation.
void RecvUnicastRipng(Ptr< Socket > socket)
Receive and process unicast packet.
std::map< Ptr< Socket >, uint32_t >::const_iterator SocketListCI
Socket list type const iterator.
SocketList m_unicastSocketList
list of sockets for unicast messages (socket, interface index)
uint8_t GetInterfaceMetric(uint32_t interface) const
Get the metric for an interface.
bool RouteInput(Ptr< const Packet > p, const Ipv6Header &header, Ptr< const NetDevice > idev, const UnicastForwardCallback &ucb, const MulticastForwardCallback &mcb, const LocalDeliverCallback &lcb, const ErrorCallback &ecb) override
Route an input packet (to be forwarded or locally delivered)
Time m_unsolicitedUpdate
time between two Unsolicited Routing Updates
std::set< uint32_t > m_interfaceExclusions
Set of excluded interfaces.
void SetInterfaceMetric(uint32_t interface, uint8_t metric)
Set the metric for an interface.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
void DeleteRoute(RipNgRoutingTableEntry *route)
Delete a route.
void AddNetworkRouteTo(Ipv6Address network, Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse)
Add route to network.
void RecvMulticastRipng(Ptr< Socket > socket)
Receive and process multicast packet.
Time m_garbageCollectionDelay
Delay before deleting an INVALID route.
std::map< uint32_t, uint8_t > m_interfaceMetrics
Map of interface metrics.
void SendRouteRequest()
Send Routing Request on all interfaces.
void NotifyInterfaceDown(uint32_t interface) override
Notify when specified interface goes DOWN.
std::map< Ptr< Socket >, uint32_t > SocketList
Socket list type.
std::list< std::pair< RipNgRoutingTableEntry *, EventId > > Routes
Container for the network routes - pair RipNgRoutingTableEntry *, EventId (update event)
Ptr< Ipv6 > m_ipv6
IPv6 reference.
Routes m_routes
the forwarding table for network.
std::set< uint32_t > GetInterfaceExclusions() const
Get the set of interface excluded from the protocol.
void SendTriggeredRouteUpdate()
Send Triggered Routing Updates on all interfaces.
void HandleRequests(RipNgHeader hdr, Ipv6Address senderAddress, uint16_t senderPort, uint32_t incomingInterface, uint8_t hopLimit)
Handle RIPng requests.
Ptr< UniformRandomVariable > m_rng
Rng stream.
void HandleResponses(RipNgHeader hdr, Ipv6Address senderAddress, uint32_t incomingInterface, uint8_t hopLimit)
Handle RIPng responses.
void NotifyRemoveRoute(Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address::GetZero()) override
Notify route removing.
static TypeId GetTypeId()
Get the type ID.
void InvalidateRoute(RipNgRoutingTableEntry *route)
Invalidate a route.
std::list< std::pair< RipNgRoutingTableEntry *, EventId > >::iterator RoutesI
Iterator for container for the network routes.
void SetIpv6(Ptr< Ipv6 > ipv6) override
Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol.
void Receive(Ptr< Socket > socket)
Receive RIPng packets.
void AddDefaultRouteTo(Ipv6Address nextHop, uint32_t interface)
Add a default route to the router through the nextHop located on interface.
Time m_timeoutDelay
Delay before invalidating a route.
void SendUnsolicitedRouteUpdate()
Send Unsolicited Routing Updates on all interfaces.
void PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const override
Print the Routing Table entries.
Ptr< Ipv6Route > Lookup(Ipv6Address dest, bool setSource, Ptr< NetDevice >=nullptr)
Lookup in the forwarding table for destination.
RipNg Routing Table Entry.
bool IsRouteChanged() const
Get the route changed status.
uint16_t GetRouteTag() const
Get the route tag.
bool m_changed
route has been updated
void SetRouteTag(uint16_t routeTag)
Set the route tag.
uint8_t GetRouteMetric() const
Get the route metric.
void SetRouteMetric(uint8_t routeMetric)
Set the route metric.
uint8_t m_metric
route metric
Status_e m_status
route status
Status_e GetRouteStatus() const
Get the route status.
void SetRouteChanged(bool changed)
Set the route as changed.
~RipNgRoutingTableEntry() override
void SetRouteStatus(Status_e status)
Set the route status.
SocketErrno
Enumeration of the possible errors returned by a socket.
Simulation virtual time values and global simulation resolution.
Unit
The unit to use to interpret a number representing time.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)