Neighbor-index data structure for nix-vector routing.
More...
#include <nix-vector.h>
List of all members.
Detailed Description
Neighbor-index data structure for nix-vector routing.
This data structure holds a vector of "neighbor-indexes" for a simulation specific routing protocol, nix-vector routing. Theses neighbor-indexes correspond to the net-device which a node should use to route a packet. A nix-vector is built (or fetched from a cache) on-demand. The nix-vector is transmitted with the packet, and along each hop of the route, the current node extracts the appropriate neighbor-index and routes the packet.
Member Function Documentation
void ns3::NixVector::AddNeighborIndex |
( |
uint32_t |
newBits, |
|
|
uint32_t |
numberOfBits | |
|
) |
| | |
- Parameters:
-
| newBits | the neighbor-index to be added to the vector |
| numberOfBits | the number of bits that newBits contains |
Adds the neighbor index to the vector using a fair amount of bit manipulation to pack everything in efficiently.
Note: This function assumes that the number of bits to be added is always less than or equal to 32, ie., you can only span one entry of a nix-vector at a time. This is reasonable, since 32 bits gives you 2^32 possible neighbors.
uint32_t ns3::NixVector::BitCount |
( |
uint32_t |
numberOfNeighbors |
) |
const |
- Returns:
- number of bits of numberOfNeighbors
- Parameters:
-
| numberOfNeighbors | the total number of neighbors |
This function is used to determine the number of bits of numberOfNeighbors so that this value can be passed in to AddNeighborIndex or ExtractNeighborIndex.
- Returns:
- the number of bytes deserialized
- Parameters:
-
uint32_t ns3::NixVector::ExtractNeighborIndex |
( |
uint32_t |
numberOfBits |
) |
|
- Returns:
- the neighbor index
- Parameters:
-
| numberOfBits | the number of bits to extract from the vector |
Extracts the number of bits specified from the vector and returns the value extracted
Note: This function assumes that the number of bits to be extracted is always less than or equal to 32, ie., you can only span one entry of a nix-vector at a time. This is reasonable, since 32 bits gives you 2^32 possible neighbors.
uint32_t ns3::NixVector::GetRemainingBits |
( |
void |
|
) |
|
- Returns:
- number of bits remaining in the nix-vector (ie m_total - m_used)
uint32_t ns3::NixVector::GetSerializedSize |
( |
void |
|
) |
const |
- Returns:
- the number of bytes required for serialization
static TypeId ns3::NixVector::GetTypeId |
( |
void |
|
) |
[static] |
This method returns the TypeId associated to ns3::NixVector.
No Attributes defined for this type.
No TraceSources defined for this type.
Reimplemented from ns3::Object.
- Parameters:
-
| i | Buffer iterator for writing |
| size | number of bytes to write |
The documentation for this class was generated from the following files:
- src/common/nix-vector.h
- doc/introspected-doxygen.h