27 #include "ns3/point-to-point-dumbbell.h"
28 #include "ns3/constant-position-mobility-model.h"
30 #include "ns3/node-list.h"
31 #include "ns3/point-to-point-net-device.h"
32 #include "ns3/vector.h"
33 #include "ns3/ipv6-address-generator.h"
54 for (uint32_t i = 0; i < nLeftLeaf; ++i)
62 for (uint32_t i = 0; i < nRightLeaf; ++i)
139 for (uint32_t i = 0; i <
LeftCount (); ++i)
170 addressHelper.
SetBase (v6network, prefix);
175 for (uint32_t i = 0; i <
LeftCount (); ++i)
178 addressHelper.
SetBase (v6network, prefix);
194 addressHelper.
SetBase (v6network, prefix);
210 double lrx,
double lry)
231 double xAdder = xDist / 3.0;
232 double thetaL = M_PI / (
LeftCount () + 1.0);
240 loc = CreateObject<ConstantPositionMobilityModel> ();
243 Vector lrl (ulx + xAdder, uly + yDist/2.0, 0);
244 loc->SetPosition (lrl);
251 loc = CreateObject<ConstantPositionMobilityModel> ();
254 Vector rrl (ulx + xAdder * 2, uly + yDist/2.0, 0);
255 loc->SetPosition (rrl);
258 double theta = -M_PI_2 + thetaL;
259 for (uint32_t l = 0; l <
LeftCount (); ++l)
274 loc = CreateObject<ConstantPositionMobilityModel> ();
277 Vector lnl (lrl.x - std::cos (theta) * xAdder,
278 lrl.y + std::sin (theta) * xAdder, 0);
288 loc->SetPosition (lnl);
292 theta = -M_PI_2 + thetaR;
307 loc = CreateObject<ConstantPositionMobilityModel> ();
310 Vector rnl (rrl.x + std::cos (theta) * xAdder,
311 rrl.y + std::sin (theta) * xAdder, 0);
321 loc->SetPosition (rnl);
Mobility model for which the current position does not change once it has been set and until it is se...
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Ipv4Address NewNetwork(void)
Increment the network number and reset the IP address counter to the base value provided in the SetBa...
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Ipv4 addresses are stored in host order in this class.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
std::pair< Ptr< Ipv4 >, uint32_t > Get(uint32_t i) const
Get the std::pair of an Ptr<Ipv4> and interface stored at the location specified by the index.
void Add(const Ipv4InterfaceContainer &other)
Concatenate the entries in the other container with ours.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
static void Init(const Ipv6Address net, const Ipv6Prefix prefix, const Ipv6Address interfaceId="::1")
Initialise the base network and interfaceId for the generator.
static Ipv6Address GetNetwork(const Ipv6Prefix prefix)
Get the current network of the given Ipv6Prefix.
static Ipv6Address NextNetwork(const Ipv6Prefix prefix)
Get the next network according to the given Ipv6Prefix.
Helper class to auto-assign global IPv6 unicast addresses.
void SetBase(Ipv6Address network, Ipv6Prefix prefix, Ipv6Address base=Ipv6Address("::1"))
Set the base network number, network prefix, and base interface ID.
Ipv6InterfaceContainer Assign(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer with auto-assigned addresses.
Describes an IPv6 address.
Keep track of a set of IPv6 interfaces.
Ipv6Address GetAddress(uint32_t i, uint32_t j) const
Get the address for the specified index.
std::vector< std::pair< Ptr< Ipv6 >, uint32_t > >::const_iterator Iterator
Container Const Iterator for pairs of Ipv6 smart pointer / Interface Index.
void Add(Ptr< Ipv6 > ipv6, uint32_t interface)
Add a couple IPv6/interface.
Iterator Begin(void) const
Get an iterator which refers to the first pair in the container.
Describes an IPv6 prefix.
holds a vector of ns3::NetDevice pointers
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
uint32_t GetN(void) const
Get the number of Ptr<Node> stored in this container.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Ipv6InterfaceContainer m_leftLeafInterfaces6
Left Leaf interfaces (IPv6)
Ipv6InterfaceContainer m_rightLeafInterfaces6
Right Leaf interfaces (IPv6)
Ipv4InterfaceContainer m_rightRouterInterfaces
Right router interfaces (IPv4)
PointToPointDumbbellHelper(uint32_t nLeftLeaf, PointToPointHelper leftHelper, uint32_t nRightLeaf, PointToPointHelper rightHelper, PointToPointHelper bottleneckHelper)
Create a PointToPointDumbbellHelper in order to easily create dumbbell topologies using p2p links.
NetDeviceContainer m_leftRouterDevices
Left router NetDevices.
Ipv6InterfaceContainer m_rightRouterInterfaces6
Right router interfaces (IPv6)
Ipv4InterfaceContainer m_routerInterfaces
Router interfaces (IPv4)
void AssignIpv4Addresses(Ipv4AddressHelper leftIp, Ipv4AddressHelper rightIp, Ipv4AddressHelper routerIp)
Ptr< Node > GetRight() const
Ptr< Node > GetLeft() const
NetDeviceContainer m_routerDevices
Routers NetDevices.
NetDeviceContainer m_rightRouterDevices
Right router NetDevices.
NodeContainer m_rightLeaf
Right Leaf nodes.
NodeContainer m_routers
Routers.
Ipv4InterfaceContainer m_leftRouterInterfaces
Left router interfaces (IPv4)
Ipv4Address GetRightIpv4Address(uint32_t i) const
Ipv6Address GetLeftIpv6Address(uint32_t i) const
~PointToPointDumbbellHelper()
uint32_t LeftCount() const
Ipv4Address GetLeftIpv4Address(uint32_t i) const
void InstallStack(InternetStackHelper stack)
Ipv6InterfaceContainer m_leftRouterInterfaces6
Left router interfaces (IPv6)
NetDeviceContainer m_leftLeafDevices
Left Leaf NetDevices.
Ipv6Address GetRightIpv6Address(uint32_t i) const
Ipv6InterfaceContainer m_routerInterfaces6
Router interfaces (IPv6)
uint32_t RightCount() const
void BoundingBox(double ulx, double uly, double lrx, double lry)
Sets up the node canvas locations for every node in the dumbbell.
Ipv4InterfaceContainer m_rightLeafInterfaces
Right Leaf interfaces (IPv4)
void AssignIpv6Addresses(Ipv6Address network, Ipv6Prefix prefix)
NodeContainer m_leftLeaf
Left Leaf nodes.
NetDeviceContainer m_rightLeafDevices
Right Leaf NetDevices.
Ipv4InterfaceContainer m_leftLeafInterfaces
Left Leaf interfaces (IPv4)
Build a set of PointToPointNetDevice objects.
NetDeviceContainer Install(NodeContainer c)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Every class exported by the ns3 library is enclosed in the ns3 namespace.