22#include "ns3/core-module.h"
23#include "ns3/internet-apps-module.h"
24#include "ns3/internet-module.h"
25#include "ns3/lr-wpan-module.h"
26#include "ns3/mobility-module.h"
27#include "ns3/sixlowpan-module.h"
28#include "ns3/spectrum-module.h"
35main(
int argc,
char* argv[])
38 bool disablePcap =
false;
42 cmd.AddValue(
"disable-pcap",
"Disable PCAP generation on all LR‑WPAN devices", disablePcap);
43 cmd.AddValue(
"num-ln",
"Number of 6LNs (in addition to the single 6LBR)", numLn);
44 cmd.Parse(argc, argv);
48 nodes.Create(1 + numLn);
52 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
75 for (
uint32_t i = 1; i <= numLn; ++i)
81 for (
uint32_t i = 1; i <= numLn; ++i)
83 std::ostringstream oss;
84 oss <<
"fe80::ff:fe00:" << std::hex << (i + 1);
97 apps.
Start(startTime);
104 lrWpanHelper.
EnablePcapAll(std::string(
"example-sixlowpan-nd-basic"),
true);
AttributeValue implementation for Address.
holds a vector of ns3::Application pointers.
void Start(Time start) const
Start all of the Applications in this container at the start time given as a parameter.
void Stop(Time stop) const
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
void SetAttribute(const std::string &name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
Manage ASCII trace files for device models.
Parse command-line arguments.
aggregate IP/TCP/UDP functionality to existing Nodes.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
Describes an IPv6 address.
Describes an IPv6 prefix.
helps to manage and create IEEE 802.15.4 NetDevice objects
void CreateAssociatedPan(NetDeviceContainer c, uint16_t panId)
Creates an PAN with associated nodes and assigned addresses(16 and 64) from the nodes in the node con...
NetDeviceContainer Install(NodeContainer c)
Install a LrWpanNetDevice and the associated structures (e.g., channel) in the nodes.
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
void EnablePcapAll(std::string prefix, bool promiscuous=false)
Enable pcap output on each device (which is of the appropriate type) in the set of all nodes created ...
Create a ping application and associate it to a node.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Setup a sixlowpan stack to be used as a shim between IPv6 and a generic NetDevice.
Ipv6InterfaceContainer InstallSixLowPanNdNode(NetDeviceContainer c)
Install the SixLoWPAN-ND stack, associate it with a NetDevice, and set it as a 6LN.
NetDeviceContainer Install(NetDeviceContainer c)
Install the SixLoWPAN stack on top of an existing NetDevice.
void SetAdvertisedPrefix(const Ptr< NetDevice > nd, Ipv6Prefix prefix)
Add a new prefix to be advertised by 6LoWPAN-ND.
Ipv6InterfaceContainer InstallSixLowPanNdBorderRouter(NetDeviceContainer c, Ipv6Address baseAddr)
Install the SixLoWPAN-ND stack, associate it with a NetDevice, and set it as a 6LBR.
void AddAdvertisedContext(const Ptr< NetDevice > nd, Ipv6Prefix context)
Add a new context to be advertised by 6LoWPAN-ND.
Simulation virtual time values and global simulation resolution.
AttributeValue implementation for Time.
Hold an unsigned integer type.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.