Setting up a custom channel and Access Category in IEEE 802.11p

91 views
Skip to first unread message

FrancescoR

unread,
Sep 14, 2022, 1:46:46 PM9/14/22
to ns-3-users
Dear all,
I am writing you as I am having some troubles in setting up a custom IEEE 802.11p scenario.
I am particularly interested in starting from the "wave-simple-80211p.cc" example, set a different channel (e.g., channel 180 at 5.9 GHz instead of CCH at 5.89 GHz), and specify a different Access Category for my messages.
Concerning the channel number, I discovered, by delving into the code, that the WAVE helper calls phy->SetChannelNumber (ChannelManager::GetCch ()) to set the default CCH channel (i.e., channel 178).

My code, however, does the following:
...

YansWifiPhyHelper wifiPhy;
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
Ptr<YansWifiChannel> channel = wifiChannel.Create ();
wifiPhy.SetChannel (channel);

Wifi80211pHelper wifi80211p = Wifi80211pHelper::Default ();

...

NetDeviceContainer netDevices = wifi80211p.Install (wifiPhy, wifi80211pMac, nodes);


In order to call "SetChannelNumber" and change the channel to something else than CCH, I would probably need to "extract" the wifiPhy object from the YansWifiPhyHelper. This is where I am currently encountering some difficulties. Is there a standard way of doing so?

Furthermore, I am using PacketSockets, as opposed to the "wave-simple-80211p" example:
PacketSocketHelper packetSocket;
packetSocket.Install (nodes);


Probably I missed something, but I have not found so far any documentation for EDCA in IEEE 802.11p, when sending broadcast packets via PacketSocket.
The documentation mentions "SetTos()", but as I am using Packet Sockets, I cannot leverage this function.
How can I set either AC_BK, AC_BE, AC_VI or AC_VO? What is the default value when it is not explicitely set (as it happens, I suppose, in the "wave-simple-80211p" example)? Is it AC_BE?

Thank you very much in advance for your assistance.

FrancescoR

unread,
Sep 15, 2022, 11:45:19 AM9/15/22
to ns-3-users
After some additional investigation, I think I have solved the issue and found out how to change the channel and set an Access Category (AC) on IEEE 802.11p. Then, please correct me if I am doing something wrong.

Concerning the channel, I found out that it can be set with:
wifiPhy.Set ("ChannelNumber", UintegerValue(channel_number));

With wifiPhy being a YansWifiPhyHelper object and channel_number an integer (e.g., 182 to set channel 182 at 5.91 GHz).

Concerning instead the AC, I found out that a socket priority can be set directly on the Packet Socket with:
socket_ptr = Socket::CreateSocket (GetNode (), TypeId::LookupByName ("ns3::PacketSocketFactory")); // Creation of the packet socket
socket_ptr->SetPriority(up); // Setting a User Priority


With up being a User Priority (between 0 and 7) which is then mapped to a proper AC (either AC_BK, AC_BE, AC_VI or AC_VO) for every packet transmitted over the Packet Socket. I checked if the proper TID was used inside OcbWifiMac::Enqueue() (in ocb-wifi-mac.cc), and everything seems indeed to work as expected.

Dadi abdalkader

unread,
Feb 19, 2024, 4:59:56 PM2/19/24
to ns-3-users

please wich version u used of ns3 
i downloaded ns-3.41 and i did find 802.11p module
Reply all
Reply to author
Forward
0 new messages