WSMP (WAVE Short Message Protocol)

942 views
Skip to first unread message

Mohammad Afrashteh

unread,
Sep 18, 2017, 8:40:26 PM9/18/17
to ns-3-users
Hi,

1) I am new in ns-3. Please introduce APIs that implement WSMP send/receive packets.

2) Why in BSM-Application used of IPv4 address (generally IP address)? Based on IEEE 1609 (Shown in the following image) messages can be in IPv6 or WSMP formats. BSM packets send and receive through CCH then they should be WSMP. In fact, WSMP doesn't use IP address (therefore UDP that used in BSM-Application cc file as TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");). Am I right?


void BsmApplication::StartApplication () // Called at time specified by Start
{
...

// every node broadcasts WAVE BSM to potentially all other nodes
recvSink->Bind (local);
recvSink->SetAllowBroadcast (true);

// dest is broadcast address
InetSocketAddress remote = InetSocketAddress (Ipv4Address ("255.255.255.255"), wavePort);
recvSink->Connect (remote);

...
}

3) How can we extract information like nodes speed, acceleration, position etc. from BSM packets?

Thank you.

Konstantinos

unread,
Sep 19, 2017, 4:22:18 AM9/19/17
to ns-3-users
Hi,

Please see replies inline.

Regards
K


On Tuesday, September 19, 2017 at 1:40:26 AM UTC+1, Mohammad Afrashteh wrote:
Hi,

1) I am new in ns-3. Please introduce APIs that implement WSMP send/receive packets.


 
2) Why in BSM-Application used of IPv4 address (generally IP address)? Based on IEEE 1609 (Shown in the following image) messages can be in IPv6 or WSMP formats. BSM packets send and receive through CCH then they should be WSMP. In fact, WSMP doesn't use IP address (therefore UDP that used in BSM-Application cc file as TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");). Am I right?

Yes, you are right that in the standard, BSM packets are non-IP. However, the BsmApplication implemented in ns-3 is a simple CBR traffic generator. We would welcome efforts to make a stanard compliant. 

 


void BsmApplication::StartApplication () // Called at time specified by Start
{
...

// every node broadcasts WAVE BSM to potentially all other nodes
recvSink->Bind (local);
recvSink->SetAllowBroadcast (true);

// dest is broadcast address
InetSocketAddress remote = InetSocketAddress (Ipv4Address ("255.255.255.255"), wavePort);
recvSink->Connect (remote);

...
}

3) How can we extract information like nodes speed, acceleration, position etc. from BSM packets?


Following the answer in (2), BSM packets in ns-3 a dummy packets, not holding ANY information on the node/vehicle. 
 
Thank you.
Message has been deleted

Mohammad Afrashteh

unread,
Sep 19, 2017, 9:22:28 AM9/19/17
to ns-3-users
Thank you, Konstantinos for your reply.

Now when I send WSMP packet by SendX I get this compile error:
error: ‘class ns3::NetDevice’ has no member named ‘SendX’

NetDeviceContainer netDeviceContainerVehicle = waveHelperVehicle.Install(yansWifiPhyHelperVehicle, qosWaveMacHelperVehicle, nodeContainerVehicle);

const TxInfo txInfo = TxInfo(CCH, 7, WifiMode("OfdmRate6MbpsBW10MHz"), 0);
const static uint16_t WSMP_PORT_NUMBER = 0x88DC;
Ptr<Packet> p = Create<Packet>(100);
netDeviceContainerVehicle.Get(0)->SendX(p, netDeviceContainerVehicle.Get(0)->GetBroadcast, WSMP_PORT_NUMBER, txInfo);

We know WaveHelper::Install takes WaveNetDevice and returns to NetDeviceContainer!

I try to cast NetDevice to WaveNetDevice to solve this problem but this time I get this error:
error: invalid use of non-static member function
 waveNetDevice->SendX(p, waveNetDevice->GetBroadcast, WSMP_PORT_NUMBER, txInfo);

Ptr<WaveNetDevice> waveNetDevice = DynamicCast<WaveNetDevice>(netDeviceContainerVehicle.Get(0));
waveNetDevice->SendX(p, waveNetDevice->GetBroadcast, WSMP_PORT_NUMBER, txInfo);

Mohammad Afrashteh

unread,
Sep 19, 2017, 10:00:58 AM9/19/17
to ns-3-users
The problem solved by replacing waveNetDevice->GetBroadcast() to Mac48Address::GetBroadcast().

I scheduled SendX to send packets:

float indexCounter = 0.0;

void test(Ptr<WaveNetDevice> wnd)
{
    const TxInfo txInfo = TxInfo(CCH, 7, WifiMode("OfdmRate6MbpsBW10MHz"), 0);
const uint16_t WSMP_PORT_NUMBER = 0x88DC;
Ptr<Packet> p = Create<Packet>(100);

wnd->SendX(p, Mac48Address::GetBroadcast(), WSMP_PORT_NUMBER, txInfo);

    indexCounter += 0.001;

    if (indexCounter < 1.0)
    Simulator::Schedule(Seconds(indexCounter), &test, wnd);
}

Ptr<WaveNetDevice> waveNetDevice = DynamicCast<WaveNetDevice>(netDeviceContainerVehicle.Get(0));

Simulator::Schedule(Seconds(0.0), &test, waveNetDevice);

Now how can I see packets sending in NetAnim XML file? (There is only mobility information in it!)

Thanks.

Konstantinos

unread,
Sep 19, 2017, 11:00:09 AM9/19/17
to ns-3-users
For using the WaveNetDevice, I would also recommend checking the example scenario in /examples/wave-simple-device that shows how to use the multi-channel operation and send WSMP messages.

Mohammad Afrashteh

unread,
Sep 19, 2017, 5:08:52 PM9/19/17
to ns-3-users
When I place AnimationInterface in wave-simple-device.cc to create NetAnim XML file there is no packet send/receive info except two constant positions nodes to show. I think SendX method prevents the not moving nodes to send/receive packets. In fact, I want to learn how I can animate my WSMP scenario by NetAnim.

Adeel

unread,
Sep 19, 2017, 8:49:41 PM9/19/17
to ns-3-users
Hello, 

To the best of my knowledge, NetAnim can not give you a fancy packet flow diagram or packet encap/decap process. 
NetAnim is a tool that you can see or check how the overall communication is happening. Particularly, in VANET, NetAnim 
helps you to see the movement of your vehicles (nodes). 
If you really interested in tracking the packet in VANET, you should first fill the packet with some unique tags or header (because in NS3 packets are 
contains dummy bits or zeros) then generate pcap file to see the details of your packet during the data flow through the network.
If you want to get kinematic details of your vehicle, you can get them from your mobility model. 

If you could specify your goal a little bit more, I can share my knowledge regarding the VANET simulation. 

Regards, Adeel  

Mohammad Afrashteh

unread,
Sep 19, 2017, 9:55:22 PM9/19/17
to ns-3-users
Hi, Adeel,

First I thank you for your helpful guidance.

I am new to ns3 and I am interested in learning it along with my project simulation. So I am learning it step 

by step.

I want to simulate my new idea about VANET broadcasting emergency messages. I could finish assigning 

mobility to the nodes (initial position and velocity). Now I can see nodes movements in NetAnim.

Then I used WaveNetDevice to send WSMP packets (safety messages) in broadcasting manner:

// Phy, Channel and Mac Layers Declaration and Initialization

   YansWavePhyHelper yansWavePhyHelperVehicle = YansWavePhyHelper::Default();
   YansWifiChannelHelper yansWifiChannelHelperVehicle;
   Ptr<YansWifiChannel> yansWifiChannelVehicle;
   QosWaveMacHelper qosWaveMacHelperVehicle = QosWaveMacHelper::Default();
   WaveHelper waveHelperVehicle = WaveHelper::Default();

   yansWifiChannelHelperVehicle.AddPropagationLoss("ns3::TwoRayGroundPropagationLossModel", 

"Frequency", DoubleValue(5.9e9), "HeightAboveZ", DoubleValue(1.5));
   yansWifiChannelHelperVehicle.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");
   Config::SetDefault("ns3::RangePropagationLossModel::MaxRange", DoubleValue(200.00));
   yansWifiChannelVehicle = yansWifiChannelHelperVehicle.Create();
   yansWavePhyHelperVehicle.SetChannel(yansWifiChannelVehicle);
   waveHelperVehicle.SetRemoteStationManager("ns3::ConstantRateWifiManager", "DataMode", StringValue("OfdmRate6MbpsBW10MHz"),
                                                                               "ControlMode", StringValue("OfdmRate6MbpsBW10MHz"), "NonUnicastMode", StringValue("OfdmRate6MbpsBW10MHz"),
                                                                               "RtsCtsThreshold", StringValue("1024"));

   NetDeviceContainer netDeviceContainerVehicle = waveHelperVehicle.Install(yansWavePhyHelperVehicle, 

qosWaveMacHelperVehicle, nodeContainerVehicle);

   // Packet Sending

   Ptr<WaveNetDevice> waveNetDevice = DynamicCast<WaveNetDevice>(netDeviceContainerVehicle.Get(0));
   Simulator::Schedule(Seconds(0.0), &test, waveNetDevice);

And test function to schedule broadcast packets is:

float indexCounter = 0.0;

void test(Ptr<WaveNetDevice> wnd)
{
    const TxInfo txInfo = TxInfo(CCH, 7, WifiMode("OfdmRate6MbpsBW10MHz"), 0);
    const uint16_t WSMP_PORT_NUMBER = 0x88DC;
    Ptr<Packet> p = Create<Packet>(100);

    wnd->SendX(p, Mac48Address::GetBroadcast(), WSMP_PORT_NUMBER, txInfo);

    indexCounter += 0.05;

    if (indexCounter < 5.0)
    Simulator::Schedule(Seconds(indexCounter), &test, wnd);
}

After running this script there is no any send/receive info in NetAnim XML file! But only nodes movement! As 

Konstantinos suggested, I review wave-simple-device.cc and add AnimationInterface animationInterface

("Filename.xml") but again There was not any send/receive info in XML file!

I want to know what is the problem to visualize my scenario in NetAnim.

Then as you said I should use PCAP to analyze my idea that I have a lot of question when I receive there.

Again thank you for sharing your knowledge and help to the growth of science.
Reply all
Reply to author
Forward
0 new messages