A Discrete-Event Network Simulator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Nix-Vector Routing


class  ns3::Ipv4NixVectorRouting
 Nix-vector routing protocol. More...


typedef std::map< Ipv4Address,
Ptr< Ipv4Route > > 
 Map of Ipv4Address to Ipv4Route. More...
typedef std::map< Ipv4Address,
Ptr< NixVector > > 
 Map of Ipv4Address to NixVector. More...

Detailed Description


Nix-vector routing is a simulation specific routing protocol and is intended for large network topologies. The on-demand nature of this protocol as well as the low-memory footprint of the nix-vector provides improved performance in terms of memory usage and simulation run time when dealing with a large number of nodes.

Currently, the ns-3 model of nix-vector routing supports IPv4 p2p links as well as CSMA links. It does not (yet) provide support for efficient adaptation to link failures. It simply flushes all nix-vector routing caches. Finally, IPv6 is not supported.

API and Usage

The Nix-vector routing protocol must be added to a list of routing protocols. It is important that list routing is utilized.


Ipv4NixVectorHelper nixRouting; Ipv4StaticRoutingHelper staticRouting;

Ipv4ListRoutingHelper list; list.Add (staticRouting, 0); list.Add (nixRouting, 10);

InternetStackHelper stack; stack.SetRoutingHelper (list); stack.Install (allNodes);


ns-3 nix-vector-routing performs on-demand route computation using a breadth-first search and an efficient route-storage data structure known as a nix-vector. When a packet is generated at a node for transmission, the route is calculated, and the nix-vector is built. The nix-vector stores an index for each hop along the path, which corresponds to the neighbor-index. This index is used to determine which net-device and gateway should be used. To route a packet, the nix-vector must be transmitted with the packet. At each hop, the current node extracts the appropriate neighbor-index from the nix-vector and transmits the packet through the corresponding net-device. This continues until the packet reaches the destination.

Typedef Documentation

typedef std::map<Ipv4Address, Ptr<Ipv4Route> > ns3::Ipv4RouteMap_t

Map of Ipv4Address to Ipv4Route.

Definition at line 46 of file ipv4-nix-vector-routing.h.

typedef std::map<Ipv4Address, Ptr<NixVector> > ns3::NixMap_t

Map of Ipv4Address to NixVector.

Definition at line 41 of file ipv4-nix-vector-routing.h.