Ns3 Projects for B.E/B.Tech M.E/M.Tech PhD Scholars.  Phone-Number:9790238391   E-mail: ns3simulation@gmail.com

vanet simulation using ns3 and sumo

          This is the article which is proposed to tell indispensable fine points about the utilization of network simulator 3 code along with vehicular ad hoc network (VANET).

         Before getting to know about the significance of VANET Ns3 code, we have to know some sample codes based on network simulator 3.

  • Packet transmission
Ptr sender = DynamicCast (devices.Get (0));
Ptr receiver = DynamicCast (devices.Get (1));
const static uint16_t WSMP_PROT_NUMBER = 0x88DC;
Mac48Address bssWildcard = Mac48Address::GetBroadcast ();
const TxInfo txInfo = TxInfo (channel);
Ptr p = Create (100);
SeqTsHeader seqTs;
seqTs.SetSeq (seq);
p->AddHeader (seqTs);
sender->SendX (p, bssWildcard, WSMP_PROT_NUMBER, txInfo);
  • Wave configuration
YansWifiChannelHelper waveChannel = YansWifiChannelHelper::Default ();
YansWavePhyHelper wavePhy = YansWavePhyHelper::Default ();
wavePhy.SetChannel (waveChannel.Create ());
wavePhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11);
QosWaveMacHelper waveMac = QosWaveMacHelper::Default ();
WaveHelper waveHelper = WaveHelper::Default ();
devices = waveHelper.Install (wavePhy, waveMac, nodes);
for (uint32_t i = 0; i != devices.GetN (); ++i)
{
Ptr device = DynamicCast (devices.Get (i));
device->SetReceiveCallback (MakeCallback (&WaveNetDeviceExample::Receive, this));
device->SetWaveVsaCallback (MakeCallback (&WaveNetDeviceExample::ReceiveVsa, this));
}
  • Include header files
#include "ns3/command-line.h"
#include "ns3/node.h"
#include "ns3/packet.h"
#include "ns3/simulator.h"
#include "ns3/node-container.h"
#include "ns3/net-device-container.h"
#include "ns3/yans-wifi-helper.h"
#include "ns3/mobility-helper.h"
#include "ns3/seq-ts-header.h"
#include "ns3/wave-net-device.h"
#include "ns3/wave-mac-helper.h"
#include "ns3/wave-helper.h"

            Consequently, we have to know the significance of the performance based on wave modules of Vanet based simulation process and that is stored in the following location.

/home/research/new ns-allinone-3.26/ns-3.26/src
Location of Wave Modules

              Suppose, if you have any issues while implementing by your own just make a call to get clear about network simulator 3.