Global routing protocol for IPv4 stacks. More...
#include "global-routing.h"
Public Types | |
| typedef Callback< void, Ptr< const Packet >, const IpHeader &, Socket::SocketErrno > | ErrorCallback |
| Callback for routing errors (e.g., no route found). | |
| typedef Callback< void, Ptr< const Packet >, const IpHeader &, uint32_t > | LocalDeliverCallback |
| Callback for packets to be locally delivered. | |
| typedef std::conditional_t< IsIpv4, MulticastForwardCallbackv4, MulticastForwardCallbackv6 > | MulticastForwardCallback |
| Callback for multicast packets to be forwarded. | |
| typedef Callback< void, Ptr< Ipv4MulticastRoute >, Ptr< const Packet >, const IpHeader & > | MulticastForwardCallbackv4 |
| Callback for IPv4 multicast packets to be forwarded. | |
| typedef Callback< void, Ptr< const NetDevice >, Ptr< Ipv6MulticastRoute >, Ptr< const Packet >, const IpHeader & > | MulticastForwardCallbackv6 |
| Callback for IPv6 multicast packets to be forwarded. | |
| typedef std::conditional_t< IsIpv4, UnicastForwardCallbackv4, UnicastForwardCallbackv6 > | UnicastForwardCallback |
| Callback for unicast packets to be forwarded. | |
| typedef Callback< void, Ptr< IpRoute >, Ptr< const Packet >, const IpHeader & > | UnicastForwardCallbackv4 |
| Callback for IPv4 unicast packets to be forwarded. | |
| typedef Callback< void, Ptr< const NetDevice >, Ptr< IpRoute >, Ptr< const Packet >, const IpHeader & > | UnicastForwardCallbackv6 |
| Callback for IPv6 unicast packets to be forwarded. | |
Public Member Functions | |
| GlobalRouting () | |
| Construct an empty Ipv4GlobalRouting routing protocol,. | |
| ~GlobalRouting () | |
| void | AddASExternalRouteTo (IpAddress network, IpMaskOrPrefix networkMask, IpAddress nextHop, uint32_t interface) |
| Add an external route to the global routing table. | |
| void | AddHostRouteTo (IpAddress dest, IpAddress nextHop, uint32_t interface) |
| Add a host route to the global routing table. | |
| void | AddHostRouteTo (IpAddress dest, uint32_t interface) |
| Add a host route to the global routing table. | |
| void | AddNetworkRouteTo (IpAddress network, IpMaskOrPrefix networkMask, IpAddress nextHop, uint32_t interface) |
| Add a network route to the global routing table. | |
| void | AddNetworkRouteTo (IpAddress network, IpMaskOrPrefix networkMask, uint32_t interface) |
| Add a network route to the global routing table. | |
| int64_t | AssignStreams (int64_t stream) |
| Assign a fixed random variable stream number to the random variables used by this model. | |
| uint32_t | GetNRoutes () const |
| Get the number of individual unicast routes that have been added to the routing table. | |
| IpRoutingTableEntry * | GetRoute (uint32_t i) const |
| Get a route from the global unicast routing table. | |
| void | NotifyAddAddress (uint32_t interface, IpInterfaceAddress address) |
| virtual void | NotifyAddRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address::GetZero()) |
| Notify a new route. | |
| void | NotifyInterfaceDown (uint32_t interface) |
| void | NotifyInterfaceUp (uint32_t interface) |
| void | NotifyRemoveAddress (uint32_t interface, IpInterfaceAddress address) |
| virtual void | NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address::GetZero()) |
| Notify route removing. | |
| void | PrintRoutingTable (Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const |
| Print the Routing Table entries. | |
| void | RemoveRoute (uint32_t i) |
| Remove a route from the global unicast routing table. | |
| 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< 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. | |
| virtual void | SetIpv6 (Ptr< Ip > ipv6) |
| Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol. | |
Static Public Member Functions | |
| static TypeId | GetTypeId () |
| Get the type ID. | |
Protected Member Functions | |
| void | DoDispose () |
Private Types | |
| typedef std::list< IpRoutingTableEntry * > | ASExternalRoutes |
| container of Ipv4RoutingTableEntry (routes to external AS) | |
| typedef std::list< IpRoutingTableEntry * >::const_iterator | ASExternalRoutesCI |
| const iterator of container of Ipv4RoutingTableEntry (routes to external AS) | |
| typedef std::list< IpRoutingTableEntry * >::iterator | ASExternalRoutesI |
| iterator of container of Ipv4RoutingTableEntry (routes to external AS) | |
| typedef std::list< IpRoutingTableEntry * > | HostRoutes |
| container of Ipv4RoutingTableEntry (routes to hosts) | |
| typedef std::list< IpRoutingTableEntry * >::const_iterator | HostRoutesCI |
| const iterator of container of Ipv4RoutingTableEntry (routes to hosts) | |
| typedef std::list< IpRoutingTableEntry * >::iterator | HostRoutesI |
| iterator of container of Ipv4RoutingTableEntry (routes to hosts) | |
| using | Ip = typename std::conditional_t<IsIpv4, Ipv4, Ipv6> |
| Alias for Ipv4 and Ipv6 classes. | |
| using | IpAddress = typename std::conditional_t<IsIpv4, Ipv4Address, Ipv6Address> |
| Alias for Ipv4Address and Ipv6Address classes. | |
| using | IpHeader = typename std::conditional_t<IsIpv4, Ipv4Header, Ipv6Header> |
| Alias for Ipv4Header and Ipv6Header classes. | |
| using | IpInterfaceAddress |
| Alias for Ipv4InterfaceAddress and Ipv6InterfaceAddress classes. | |
| using | IpManager = typename std::conditional_t<IsIpv4, Ipv4Manager, Ipv6Manager> |
| Alias for Ipv4Manager and Ipv6Manager classes. | |
| using | IpMaskOrPrefix = typename std::conditional_t<IsIpv4, Ipv4Mask, Ipv6Prefix> |
| Alias for Ipv4Mask And Ipv6Prefix. | |
| using | IpRoute = typename std::conditional_t<IsIpv4, Ipv4Route, Ipv6Route> |
| Alias for Ipv4Route and Ipv6Route classes. | |
| using | IpRoutingProtocol |
| Alias for Ipv4RoutingProtocol and Ipv6RoutingProtocol classes. | |
| using | IpRoutingTableEntry |
| Alias for Ipv4RoutingTableEntry and Ipv6RoutingTableEntry classes. | |
| typedef std::list< IpRoutingTableEntry * > | NetworkRoutes |
| container of Ipv4RoutingTableEntry (routes to networks) | |
| typedef std::list< IpRoutingTableEntry * >::const_iterator | NetworkRoutesCI |
| const iterator of container of Ipv4RoutingTableEntry (routes to networks) | |
| typedef std::list< IpRoutingTableEntry * >::iterator | NetworkRoutesI |
| iterator of container of Ipv4RoutingTableEntry (routes to networks) | |
Private Member Functions | |
| Ptr< IpRoute > | LookupGlobal (IpAddress dest, Ptr< NetDevice > oif=nullptr) |
| Lookup in the forwarding table for destination. | |
Private Attributes | |
| ASExternalRoutes | m_ASexternalRoutes |
| External routes imported. | |
| HostRoutes | m_hostRoutes |
| Routes to hosts. | |
| Ptr< Ip > | m_ip |
| associated IPv4 instance | |
| NetworkRoutes | m_networkRoutes |
| Routes to networks. | |
| Ptr< UniformRandomVariable > | m_rand |
| A uniform random number generator for randomly routing packets among ECMP. | |
| bool | m_randomEcmpRouting |
| Set to true if packets are randomly routed among ECMP; set to false for using only one route consistently. | |
| bool | m_respondToInterfaceEvents |
| Set to true if this interface should respond to interface events by globally recomputing routes. | |
Static Private Attributes | |
| static constexpr bool | IsIpv4 = std::is_same_v<Ipv4RoutingProtocol, T> |
| Alias for determining whether the parent is Ipv4RoutingHelper or Ipv6RoutingHelper. | |
Friends | |
| template<typename> | |
| class | GlobalRouteManagerImpl |
Global routing protocol for IPv4 stacks.
In ns-3 we have the concept of a pluggable routing protocol. Routing protocols are added to a list maintained by the Ipv4L3Protocol. Every stack gets one routing protocol for free – the Ipv4StaticRouting routing protocol is added in the constructor of the Ipv4L3Protocol (this is the piece of code that implements the functionality of the IP layer).
As an option to running a dynamic routing protocol, a GlobalRouteManager object has been created to allow users to build routes for all participating nodes. One can think of this object as a "routing oracle"; it has an omniscient view of the topology, and can construct shortest path routes between all pairs of nodes. These routes must be stored somewhere in the node, so therefore this class Ipv4GlobalRouting is used as one of the pluggable routing protocols. It is kept distinct from Ipv4StaticRouting because these routes may be dynamically cleared and rebuilt in the middle of the simulation, while manually entered routes into the Ipv4StaticRouting may need to be kept distinct.
This class deals with Ipv4 unicast routes only.
Definition at line 139 of file global-routing.h.
|
private |
container of Ipv4RoutingTableEntry (routes to external AS)
Definition at line 525 of file global-routing.h.
|
private |
const iterator of container of Ipv4RoutingTableEntry (routes to external AS)
Definition at line 527 of file global-routing.h.
|
private |
iterator of container of Ipv4RoutingTableEntry (routes to external AS)
Definition at line 529 of file global-routing.h.
| typedef Callback<void, Ptr<const Packet>, const IpHeader&, Socket::SocketErrno> ns3::GlobalRouting< T >::ErrorCallback |
Callback for routing errors (e.g., no route found).
Definition at line 249 of file global-routing.h.
|
private |
container of Ipv4RoutingTableEntry (routes to hosts)
Definition at line 511 of file global-routing.h.
|
private |
const iterator of container of Ipv4RoutingTableEntry (routes to hosts)
Definition at line 513 of file global-routing.h.
|
private |
iterator of container of Ipv4RoutingTableEntry (routes to hosts)
Definition at line 515 of file global-routing.h.
|
private |
Alias for Ipv4 and Ipv6 classes.
Definition at line 149 of file global-routing.h.
|
private |
Alias for Ipv4Address and Ipv6Address classes.
Definition at line 151 of file global-routing.h.
|
private |
Alias for Ipv4Header and Ipv6Header classes.
Definition at line 157 of file global-routing.h.
|
private |
Alias for Ipv4InterfaceAddress and Ipv6InterfaceAddress classes.
Definition at line 173 of file global-routing.h.
|
private |
Alias for Ipv4Manager and Ipv6Manager classes.
Definition at line 170 of file global-routing.h.
|
private |
Alias for Ipv4Mask And Ipv6Prefix.
Definition at line 163 of file global-routing.h.
|
private |
Alias for Ipv4Route and Ipv6Route classes.
Definition at line 160 of file global-routing.h.
|
private |
Alias for Ipv4RoutingProtocol and Ipv6RoutingProtocol classes.
Definition at line 153 of file global-routing.h.
|
private |
Alias for Ipv4RoutingTableEntry and Ipv6RoutingTableEntry classes.
Definition at line 166 of file global-routing.h.
| typedef Callback<void, Ptr<const Packet>, const IpHeader&, uint32_t> ns3::GlobalRouting< T >::LocalDeliverCallback |
Callback for packets to be locally delivered.
Definition at line 246 of file global-routing.h.
| typedef std::conditional_t<IsIpv4, MulticastForwardCallbackv4, MulticastForwardCallbackv6> ns3::GlobalRouting< T >::MulticastForwardCallback |
Callback for multicast packets to be forwarded.
Definition at line 243 of file global-routing.h.
| typedef Callback<void, Ptr<Ipv4MulticastRoute>, Ptr<const Packet>, const IpHeader&> ns3::GlobalRouting< T >::MulticastForwardCallbackv4 |
Callback for IPv4 multicast packets to be forwarded.
Definition at line 230 of file global-routing.h.
| typedef Callback<void, Ptr<const NetDevice>, Ptr<Ipv6MulticastRoute>, Ptr<const Packet>, const IpHeader&> ns3::GlobalRouting< T >::MulticastForwardCallbackv6 |
Callback for IPv6 multicast packets to be forwarded.
Definition at line 238 of file global-routing.h.
|
private |
container of Ipv4RoutingTableEntry (routes to networks)
Definition at line 518 of file global-routing.h.
|
private |
const iterator of container of Ipv4RoutingTableEntry (routes to networks)
Definition at line 520 of file global-routing.h.
|
private |
iterator of container of Ipv4RoutingTableEntry (routes to networks)
Definition at line 522 of file global-routing.h.
| typedef std::conditional_t<IsIpv4, UnicastForwardCallbackv4, UnicastForwardCallbackv6> ns3::GlobalRouting< T >::UnicastForwardCallback |
Callback for unicast packets to be forwarded.
Definition at line 226 of file global-routing.h.
| typedef Callback<void, Ptr<IpRoute>, Ptr<const Packet>, const IpHeader&> ns3::GlobalRouting< T >::UnicastForwardCallbackv4 |
Callback for IPv4 unicast packets to be forwarded.
Definition at line 218 of file global-routing.h.
| typedef Callback<void, Ptr<const NetDevice>, Ptr<IpRoute>, Ptr<const Packet>, const IpHeader&> ns3::GlobalRouting< T >::UnicastForwardCallbackv6 |
Callback for IPv6 unicast packets to be forwarded.
Definition at line 222 of file global-routing.h.
| ns3::GlobalRouting< T >::GlobalRouting | ( | ) |
Construct an empty Ipv4GlobalRouting routing protocol,.
The Ipv4GlobalRouting class supports host and network unicast routes. This method initializes the lists containing these routes to empty.
Definition at line 84 of file global-routing.cc.
References ns3::CreateObject(), m_rand, m_randomEcmpRouting, m_respondToInterfaceEvents, and NS_LOG_FUNCTION.
| ns3::GlobalRouting< T >::~GlobalRouting | ( | ) |
Definition at line 94 of file global-routing.cc.
References NS_LOG_FUNCTION.
| void ns3::GlobalRouting< T >::AddASExternalRouteTo | ( | IpAddress | network, |
| IpMaskOrPrefix | networkMask, | ||
| IpAddress | nextHop, | ||
| uint32_t | interface ) |
Add an external route to the global routing table.
| network | The Ipv4Address network for this route. |
| networkMask | The Ipv4Mask to extract the network. |
| nextHop | The next hop Ipv4Address |
| interface | The network interface index used to send packets to the destination. |
Definition at line 182 of file global-routing.cc.
References m_ASexternalRoutes, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
| void ns3::GlobalRouting< T >::AddHostRouteTo | ( | IpAddress | dest, |
| IpAddress | nextHop, | ||
| uint32_t | interface ) |
Add a host route to the global routing table.
| dest | The Ipv4Address destination for this route. |
| nextHop | The Ipv4Address of the next hop in the route. |
| interface | The network interface index used to send packets to the destination. |
Definition at line 101 of file global-routing.cc.
References m_hostRoutes, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
| void ns3::GlobalRouting< T >::AddHostRouteTo | ( | IpAddress | dest, |
| uint32_t | interface ) |
Add a host route to the global routing table.
| dest | The Ipv4Address destination for this route. |
| interface | The network interface index used to send packets to the destination. |
Definition at line 120 of file global-routing.cc.
References m_hostRoutes, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
| void ns3::GlobalRouting< T >::AddNetworkRouteTo | ( | IpAddress | network, |
| IpMaskOrPrefix | networkMask, | ||
| IpAddress | nextHop, | ||
| uint32_t | interface ) |
Add a network route to the global routing table.
| network | The Ipv4Address network for this route. |
| networkMask | The Ipv4Mask to extract the network. |
| nextHop | The next hop in the route to the destination network. |
| interface | The network interface index used to send packets to the destination. |
Definition at line 139 of file global-routing.cc.
References m_networkRoutes, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
| void ns3::GlobalRouting< T >::AddNetworkRouteTo | ( | IpAddress | network, |
| IpMaskOrPrefix | networkMask, | ||
| uint32_t | interface ) |
Add a network route to the global routing table.
| network | The Ipv4Address network for this route. |
| networkMask | The Ipv4Mask to extract the network. |
| interface | The network interface index used to send packets to the destination. |
Definition at line 161 of file global-routing.cc.
References m_networkRoutes, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
| int64_t ns3::GlobalRouting< T >::AssignStreams | ( | int64_t | stream | ) |
Assign a fixed random variable stream number to the random variables used by this model.
Return the number of streams (possibly zero) that have been assigned.
| stream | first stream index to use |
Definition at line 463 of file global-routing.cc.
References m_rand, and NS_LOG_FUNCTION.
|
protected |
Definition at line 472 of file global-routing.cc.
References m_ASexternalRoutes, m_hostRoutes, m_networkRoutes, and NS_LOG_FUNCTION.
| uint32_t ns3::GlobalRouting< T >::GetNRoutes | ( | ) | const |
Get the number of individual unicast routes that have been added to the routing table.
Definition at line 351 of file global-routing.cc.
References m_ASexternalRoutes, m_hostRoutes, m_networkRoutes, and NS_LOG_FUNCTION.
Referenced by PrintRoutingTable().
| GlobalRouting< T >::IpRoutingTableEntry * ns3::GlobalRouting< T >::GetRoute | ( | uint32_t | i | ) | const |
Get a route from the global unicast routing table.
Externally, the unicast global routing table appears simply as a table with n entries. The one subtlety of note is that if a default route has been set it will appear as the zeroth entry in the table. This means that if you add only a default route, the table will have one entry that can be accessed either by explicitly calling GetDefaultRoute () or by calling GetRoute (0).
Similarly, if the default route has been set, calling RemoveRoute (0) will remove the default route.
| i | The index (into the routing table) of the route to retrieve. If the default route has been set, it will occupy index zero. |
Definition at line 363 of file global-routing.cc.
References m_ASexternalRoutes, m_hostRoutes, m_networkRoutes, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by PrintRoutingTable().
|
static |
Get the type ID.
Definition at line 33 of file global-routing.cc.
References ns3::TypeId::AddAttribute(), IsIpv4, m_randomEcmpRouting, m_respondToInterfaceEvents, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), and ns3::TypeId::SetParent().
|
private |
Lookup in the forwarding table for destination.
| dest | destination address |
| oif | output interface if any (put 0 otherwise) |
Definition at line 204 of file global-routing.cc.
References ns3::Create(), IsIpv4, m_ASexternalRoutes, m_hostRoutes, m_ip, m_networkRoutes, m_rand, m_randomEcmpRouting, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by RouteInput(), and RouteOutput().
| void ns3::GlobalRouting< T >::NotifyAddAddress | ( | uint32_t | interface, |
| IpInterfaceAddress | address ) |
| interface | the index of the interface we are being notified about |
| address | a new address being added to an interface |
Definition at line 716 of file global-routing.cc.
References ns3::GlobalRouteManager< T >::BuildGlobalRoutingDatabase(), ns3::GlobalRouteManager< T >::DeleteGlobalRoutes(), ns3::GlobalRouteManager< T >::InitializeRoutes(), m_respondToInterfaceEvents, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
|
virtual |
Notify a new route.
Typically this is used to add another route from IPv6 stack (i.e. ICMPv6 redirect case, ...).
| dst | destination address |
| mask | destination mask |
| nextHop | nextHop for this destination |
| interface | output interface |
| prefixToUse | prefix to use as source with this route |
Definition at line 742 of file global-routing.cc.
| void ns3::GlobalRouting< T >::NotifyInterfaceDown | ( | uint32_t | interface | ) |
| interface | the index of the interface we are being notified about |
Definition at line 703 of file global-routing.cc.
References ns3::GlobalRouteManager< T >::BuildGlobalRoutingDatabase(), ns3::GlobalRouteManager< T >::DeleteGlobalRoutes(), ns3::GlobalRouteManager< T >::InitializeRoutes(), m_respondToInterfaceEvents, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
| void ns3::GlobalRouting< T >::NotifyInterfaceUp | ( | uint32_t | interface | ) |
| interface | the index of the interface we are being notified about |
Definition at line 690 of file global-routing.cc.
References ns3::GlobalRouteManager< T >::BuildGlobalRoutingDatabase(), ns3::GlobalRouteManager< T >::DeleteGlobalRoutes(), ns3::GlobalRouteManager< T >::InitializeRoutes(), m_respondToInterfaceEvents, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
| void ns3::GlobalRouting< T >::NotifyRemoveAddress | ( | uint32_t | interface, |
| IpInterfaceAddress | address ) |
| interface | the index of the interface we are being notified about |
| address | a new address being added to an interface |
Definition at line 729 of file global-routing.cc.
References ns3::GlobalRouteManager< T >::BuildGlobalRoutingDatabase(), ns3::GlobalRouteManager< T >::DeleteGlobalRoutes(), ns3::GlobalRouteManager< T >::InitializeRoutes(), m_respondToInterfaceEvents, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
|
virtual |
Notify route removing.
| dst | destination address |
| mask | destination mask |
| nextHop | nextHop for this destination |
| interface | output interface |
| prefixToUse | prefix to use as source with this route |
Definition at line 752 of file global-routing.cc.
| void ns3::GlobalRouting< T >::PrintRoutingTable | ( | Ptr< OutputStreamWrapper > | stream, |
| Time::Unit | unit = Time::S ) const |
Print the Routing Table entries.
| stream | The ostream the Routing table is printed to |
| unit | The time unit to be used in the report |
Definition at line 495 of file global-routing.cc.
References ns3::Time::As(), ns3::Names::FindName(), GetNRoutes(), GetRoute(), IsIpv4, m_ip, ns3::Now(), and NS_LOG_FUNCTION.
| void ns3::GlobalRouting< T >::RemoveRoute | ( | uint32_t | i | ) |
Remove a route from the global unicast routing table.
Externally, the unicast global routing table appears simply as a table with n entries. The one subtlety of note is that if a default route has been set it will appear as the zeroth entry in the table. This means that if the default route has been set, calling RemoveRoute (0) will remove the default route.
| i | The index (into the routing table) of the route to remove. If the default route has been set, it will occupy index zero. |
Definition at line 408 of file global-routing.cc.
References m_ASexternalRoutes, m_hostRoutes, m_networkRoutes, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
| bool ns3::GlobalRouting< T >::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).
| p | received packet |
| header | input parameter used to form a search key for a route |
| idev | Pointer to ingress network device |
| ucb | Callback for the case in which the packet is to be forwarded as unicast |
| mcb | Callback for the case in which the packet is to be forwarded as multicast |
| lcb | Callback for the case in which the packet is to be locally delivered |
| ecb | Callback to call if there is an error in forwarding |
Definition at line 618 of file global-routing.cc.
References ns3::Socket::ERROR_NOROUTETOHOST, IsIpv4, ns3::Callback< R, UArgs >::IsNull(), LookupGlobal(), m_ip, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
| Ptr< typename GlobalRouting< T >::IpRoute > ns3::GlobalRouting< T >::RouteOutput | ( | Ptr< Packet > | p, |
| const IpHeader & | header, | ||
| Ptr< NetDevice > | oif, | ||
| Socket::SocketErrno & | sockerr ) |
Query routing cache for an existing route, for an outbound packet.
| p | packet to be routed. Note that this method may modify the packet. Callers may also pass in a null pointer. |
| header | input parameter (used to form key to search for the route) |
| oif | Output interface Netdevice. May be zero, or may be bound via socket options to a particular output interface. |
| sockerr | Output parameter; socket errno |
Definition at line 585 of file global-routing.cc.
References ns3::Socket::ERROR_NOROUTETOHOST, ns3::Socket::ERROR_NOTERROR, LookupGlobal(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.
|
virtual |
Typically, invoked directly or indirectly from ns3::Ipv4::SetRoutingProtocol.
| ipv4 | the ipv4 object this routing protocol is being associated with |
Definition at line 763 of file global-routing.cc.
References m_ip, NS_ASSERT, and NS_LOG_FUNCTION.
|
virtual |
Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol.
| ipv6 | the ipv6 object this routing protocol is being associated with |
Definition at line 773 of file global-routing.cc.
References m_ip, NS_ASSERT, and NS_LOG_FUNCTION.
|
friend |
Definition at line 144 of file global-routing.h.
|
staticconstexprprivate |
Alias for determining whether the parent is Ipv4RoutingHelper or Ipv6RoutingHelper.
Definition at line 147 of file global-routing.h.
Referenced by GetTypeId(), LookupGlobal(), PrintRoutingTable(), and RouteInput().
|
private |
External routes imported.
Definition at line 541 of file global-routing.h.
Referenced by AddASExternalRouteTo(), DoDispose(), GetNRoutes(), GetRoute(), LookupGlobal(), and RemoveRoute().
|
private |
Routes to hosts.
Definition at line 539 of file global-routing.h.
Referenced by AddHostRouteTo(), AddHostRouteTo(), DoDispose(), GetNRoutes(), GetRoute(), LookupGlobal(), and RemoveRoute().
|
private |
associated IPv4 instance
Definition at line 543 of file global-routing.h.
Referenced by LookupGlobal(), PrintRoutingTable(), RouteInput(), SetIpv4(), and SetIpv6().
|
private |
Routes to networks.
Definition at line 540 of file global-routing.h.
Referenced by AddNetworkRouteTo(), AddNetworkRouteTo(), DoDispose(), GetNRoutes(), GetRoute(), LookupGlobal(), and RemoveRoute().
|
private |
A uniform random number generator for randomly routing packets among ECMP.
Definition at line 508 of file global-routing.h.
Referenced by GlobalRouting(), AssignStreams(), and LookupGlobal().
|
private |
Set to true if packets are randomly routed among ECMP; set to false for using only one route consistently.
Definition at line 503 of file global-routing.h.
Referenced by GlobalRouting(), GetTypeId(), and LookupGlobal().
|
private |
Set to true if this interface should respond to interface events by globally recomputing routes.
Definition at line 506 of file global-routing.h.
Referenced by GlobalRouting(), GetTypeId(), NotifyAddAddress(), NotifyInterfaceDown(), NotifyInterfaceUp(), and NotifyRemoveAddress().