18 #include "ns3/command-line.h" 
   20 #include "ns3/packet.h" 
   21 #include "ns3/simulator.h" 
   22 #include "ns3/node-container.h" 
   23 #include "ns3/net-device-container.h" 
   24 #include "ns3/yans-wifi-helper.h" 
   25 #include "ns3/mobility-helper.h" 
   26 #include "ns3/seq-ts-header.h" 
   27 #include "ns3/wave-net-device.h" 
   28 #include "ns3/wave-mac-helper.h" 
   29 #include "ns3/wave-helper.h" 
   43   void SendWsmpExample (
void);
 
   45   void SendIpExample (
void);
 
   47   void SendWsaExample (
void);
 
   50   void SendOneWsmpPacket (uint32_t 
channel, uint32_t seq);
 
   51   void SendIpPacket (uint32_t seq, 
bool ipv6);
 
   54   void CreateWaveNodes (
void);
 
   67   positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
 
   68   positionAlloc->
Add (Vector (5.0, 0.0, 0.0));
 
   81   for (uint32_t i = 0; i != 
devices.GetN (); ++i)
 
   97   std::cout << 
"receive a packet: " << std::endl
 
   98             << 
"  sequence = " << seqTs.
GetSeq () << 
"," << std::endl
 
  100             << 
"  recvTime = " << 
Now ().
GetSeconds () << 
"s," << std::endl
 
  101             << 
"  protocol = 0x" << std::hex << mode << std::dec  << std::endl;
 
  110   const static uint16_t WSMP_PROT_NUMBER = 0x88DC;
 
  118   sender->
SendX  (p, bssWildcard, WSMP_PROT_NUMBER, txInfo);
 
  161   const Address dest = receiver->GetAddress ();
 
  163   const static uint16_t IPv4_PROT_NUMBER = 0x0800;
 
  164   const static uint16_t IPv6_PROT_NUMBER = 0x86DD;
 
  165   uint16_t protocol = ipv6 ? IPv6_PROT_NUMBER : IPv4_PROT_NUMBER;
 
  170   sender->
Send (p, dest, protocol);
 
  213   std::cout << 
"receive a VSA management frame: recvTime = " << 
Now ().
GetSeconds () << 
"s." << std::endl;
 
  251 main (
int argc, 
char *argv[])
 
  254   cmd.
Parse (argc, argv);
 
  257   std::cout << 
"run WAVE WSMP routing service case:" << std::endl;
 
  259   std::cout << 
"run WAVE IP routing service case:" << std::endl;
 
  261   std::cout << 
"run WAVE WSA routing service case:" << std::endl;
 
bool StopVsa(uint32_t channelNumber)
void SendWsaExample(void)
Smart pointer class similar to boost::intrusive_ptr. 
bool StartSch(const SchInfo &schInfo)
void SetWaveVsaCallback(WaveVsaCallback vsaCallback)
Ptr< YansWifiChannel > Create(void) const 
static YansWifiChannelHelper Default(void)
Create a channel helper in a default working state. 
bool ReceiveVsa(Ptr< const Packet >, const Address &, uint32_t, uint32_t)
This simulation is to show the routing service of WaveNetDevice described in IEEE 09...
void SendOneWsmpPacket(uint32_t channel, uint32_t seq)
static void Run(void)
Run the simulation. 
bool SendX(Ptr< Packet > packet, const Address &dest, uint32_t protocol, const TxInfo &txInfo)
void SendWsmpExample(void)
static WaveHelper Default(void)
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const 
void SetPcapDataLinkType(enum SupportedPcapDataLinkTypes dlt)
Set the data link type of PCAP traces to be used. 
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
a polymophic address class 
void SetChannel(Ptr< YansWifiChannel > channel)
double GetSeconds(void) const 
Get an approximation of the time stored in this instance in the indicated unit. 
void Install(Ptr< Node > node) const 
"Layout" a single node according to the current position allocator type. 
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay. 
#define EXTENDED_ALTERNATING
the organization identifier is a public organizationally unique identifier assigned by the IEEE...
bool DeleteTxProfile(uint32_t channelNumber)
helps to create WaveNetDevice objects 
holds a vector of ns3::NetDevice pointers 
void SendIpPacket(uint32_t seq, bool ipv6)
static Mac48Address GetBroadcast(void)
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
void CreateWaveNodes(void)
Parse command-line arguments. 
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy(). 
bool StopSch(uint32_t channelNumber)
uint32_t PeekHeader(Header &header) const 
Deserialize but does not remove the header from the internal buffer. 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
keep track of a set of node pointers. 
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
manage and create wifi channel objects for the yans model. 
To trace WaveNetDevice, we have to overwrite the trace functions of class YansWifiPhyHelper. 
NetDeviceContainer devices
Helper class used to assign positions and mobility models to nodes. 
bool StartVsa(const VsaInfo &vsaInfo)
static YansWavePhyHelper Default(void)
Create a phy helper in a default working state. 
static QosWaveMacHelper Default(void)
Create a mac helper in a default working state. 
static void Stop(void)
Tell the Simulator the calling event should be the last one executed. 
IEEE 802.11 Wireless LAN headers on packets. 
Time Seconds(double value)
Construct a Time in the indicated unit. 
void Add(Vector v)
Add a position to the list of positions. 
void Parse(int argc, char *argv[])
Parse the program arguments. 
Time Now(void)
create an ns3::Time instance which contains the current simulation time. 
void EnablePcap(std::string prefix, Ptr< NetDevice > nd, bool promiscuous=false, bool explicitFilename=false)
Enable pcap output the indicated net device. 
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...
bool Receive(Ptr< NetDevice > dev, Ptr< const Packet > pkt, uint16_t mode, const Address &sender)
bool RegisterTxProfile(const TxProfile &txprofile)
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
void AddHeader(const Header &header)
Add header to this packet.