Changing WSM(WAVE Short Message) packet size in Veins

后端 未结 2 1183
我寻月下人不归
我寻月下人不归 2020-12-11 09:45

Does setting length of WSM via setWsmLength or adding a large payload via setWsmData makes any difference during simulation? I am trying to simulat

相关标签:
2条回答
  • 2020-12-11 10:08

    You can implement a packet for your application in a .msg file as follows:

    cplusplus {{
    #include "veins/modules/messages/WaveShortMessage_m.h"
    }}
    
    class WaveShortMessage;
    
    message MyAppsPacket extends WaveShortMessage {
        string sourceAddress;           
        string destinationAddress;      
        simtime_t sendingTime;
    }
    

    Then in your code you can use the built-in setByteLength(). Use cPacket subclass for your messages because:

    (cPacket is) A subclass of cMessage that can be used to represent packets (frames, * datagrams, application messages, etc). cPacket adds length (measured in * bits or bytes), bit error flag, and encapsulation capability to cMessage. * Length and bit error flag are significant when the packet travels through * a cDatarateChannel or another channel that supports data rate and/or * error modelling. *

    Related Q&A which shows the casting from cMessage to cPacket.

    0 讨论(0)
  • 2020-12-11 10:08

    I know it is decades later, but maybe it can help some new vanets lovers like me.

    In omnet++5.4.1 and Veins 4.7.1, in the function

    populateWSM()

    defined in BaseWaveApplLayer.cc (veins/modules/application/ieee80211p), you can set the bit length with the

    wsm->setBitLength()

    method and it changes the size of the wsm packet. By default, it has the length of the header

    wsm->setBitLength(headerLength)

    I have played with this and could obtain different packet sizes.

    Hope this is useful.

    0 讨论(0)
提交回复
热议问题