ns-3
|
A helper to make it easier to create a grid topology with p2p links. More...
#include <point-to-point-grid.h>
Public Member Functions | |
PointToPointGridHelper (uint32_t nRows, uint32_t nCols, PointToPointHelper pointToPoint) | |
Ptr< Node > | GetNode (uint32_t row, uint32_t col) |
Ipv4Address | GetIpv4Address (uint32_t row, uint32_t col) |
void | InstallStack (InternetStackHelper stack) |
void | AssignIpv4Addresses (Ipv4AddressHelper rowIp, Ipv4AddressHelper colIp) |
void | BoundingBox (double ulx, double uly, double lrx, double lry) |
A helper to make it easier to create a grid topology with p2p links.
ns3::PointToPointGridHelper::PointToPointGridHelper | ( | uint32_t | nRows, |
uint32_t | nCols, | ||
PointToPointHelper | pointToPoint | ||
) |
Create a PointToPointGridHelper in order to easily create grid topologies using p2p links
nRows | total number of rows in the grid |
nCols | total number of colums in the grid |
pointToPoint | the PointToPointHelper which is used to connect all of the nodes together in the grid |
References ns3::NetDeviceContainer::Add(), ns3::NodeContainer::Create(), ns3::NodeContainer::Get(), and NS_FATAL_ERROR.
void ns3::PointToPointGridHelper::AssignIpv4Addresses | ( | Ipv4AddressHelper | rowIp, |
Ipv4AddressHelper | colIp | ||
) |
Assigns Ipv4 addresses to all the row and column interfaces
rowIp | the Ipv4AddressHelper used to assign Ipv4 addresses to all of the row interfaces in the grid |
colIp | the Ipv4AddressHelper used to assign Ipv4 addresses to all of the row interfaces in the grid |
References ns3::Ipv4InterfaceContainer::Add(), ns3::Ipv4AddressHelper::Assign(), ns3::NetDeviceContainer::Get(), ns3::NetDeviceContainer::GetN(), and ns3::Ipv4AddressHelper::NewNetwork().
void ns3::PointToPointGridHelper::BoundingBox | ( | double | ulx, |
double | uly, | ||
double | lrx, | ||
double | lry | ||
) |
Sets up the node canvas locations for every node in the grid. This is needed for use with the animation interface
ulx | upper left x value |
uly | upper left y value |
lrx | lower right x value |
lry | lower right y value |
References ns3::Object::AggregateObject(), GetNode(), and ns3::Object::GetObject().
Ipv4Address ns3::PointToPointGridHelper::GetIpv4Address | ( | uint32_t | row, |
uint32_t | col | ||
) |
This returns an Ipv4 address at the node specified by the (row, col) address. Technically, a node will have multiple interfaces in the grid; therefore, it also has multiple Ipv4 addresses. This method only returns one of the addresses. If you picture the grid, the address returned is the left row device of all the nodes, except the left-most grid nodes, which returns the right row device.
row | the row address of the node desired |
col | the column address of the node desired |
References NS_FATAL_ERROR.
Ptr< Node > ns3::PointToPointGridHelper::GetNode | ( | uint32_t | row, |
uint32_t | col | ||
) |
row | the row address of the node desired |
col | the column address of the node desired |
References NS_FATAL_ERROR.
Referenced by BoundingBox().
void ns3::PointToPointGridHelper::InstallStack | ( | InternetStackHelper | stack | ) |
stack | an InternetStackHelper which is used to install on every node in the grid |
References ns3::NodeContainer::Get(), ns3::NodeContainer::GetN(), and ns3::InternetStackHelper::Install().