Wlan, rts/cts, packet drops

699 views
Skip to first unread message

Filip

unread,
Jan 27, 2022, 6:09:27 PM1/27/22
to ns-3-users
Hello, i create network with 1 AP (server) and 2 stations (senders). I use UdpServerHelper and UdpClientHelper to create UDP communication. I set rts/cts to 1 to avoid packet collision and drops. 

Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", 1);

I check wireshark after rtscts set to 1 and UDP packet dont longer be retransmitted (retransmision bit is 0) but it output i still have drops on stations (NodeList 2 and 3) and AP (NodeList 0).

Can anybody help me avoid this packet drop ? thank you for any advice!


Simulation output with drops:

At time +2.80249s server recived 1000 bytes

At time +2.8046s server recived 1000 bytes

/NodeList/3/DeviceList/0/$ns3::WifiNetDevice/Phy/PhyRxDrop

Packet: 0x55a4d9a5adc0Reason: TXING

/NodeList/2/DeviceList/0/$ns3::WifiNetDevice/Phy/PhyRxDrop

Packet: 0x55a4d9a4e770Reason: TXING

/NodeList/0/DeviceList/0/$ns3::WifiNetDevice/Phy/PhyRxDrop

Packet: 0x55a4d9a63730Reason: BUSY_DECODING_PREAMBLE

/NodeList/0/DeviceList/0/$ns3::WifiNetDevice/Phy/PhyRxDrop

Packet: 0x55a4d9a63730Reason: PREAMBLE_DETECT_FAILURE

Soulimane Mammar

unread,
Jan 28, 2022, 7:22:54 AM1/28/22
to ns-3-users
Hi,
RTS/CTS have nothing to do with avoiding Drops/Collisions. RTS/CTS mechanism is used to minimize the cost of a collision when packets are too big.
Still RTS packets can collide and this is exactly what's happening 
Regards

Filip

unread,
Jan 28, 2022, 9:13:40 AM1/28/22
to ns-3-users
Thank you for your response. So how to avoid collisions ? I found csma module, but as far as i know that can be used only for wired network.

Dátum: piatok 28. januára 2022, čas: 13:22:54 UTC+1, odosielateľ: souliman...@gmail.com

Soulimane Mammar

unread,
Jan 28, 2022, 4:23:54 PM1/28/22
to ns-3-users
Hi,
There is no way to avoid collision in Wifi based networks. By wifi, I mean 802.11a/b/g/n/ac/ax, as theses standards use  CSMA/CA access mechanism.
However, there exist other wireless technologies (such as  2G and 3G) that use collison free channel access methods (TDMA, CDMA, TDD for instance) 
Regards

Filip

unread,
Mar 8, 2022, 9:12:38 AM3/8/22
to ns-3-users

Thank you for reply. 
If I don t use RTS/CTS and use UDP application  there is still ack and packet retransmision like TCP can I suppress these ack and retransmisions ? I would like to behave like a real UDP that doesn't care if the packet has been delivered.

Best regards
Dátum: piatok 28. januára 2022, čas: 22:23:54 UTC+1, odosielateľ: souliman...@gmail.com

Soulimane Mammar

unread,
Mar 9, 2022, 12:29:39 AM3/9/22
to ns-3-users
Hi,
First of all RTS/CTS is a mac layer mechanism and UDP is a transport layer protocol. Although UDP doesn't care about receiving  ACKs for sent packets, the mac layer tries its best to deliver the frames to the next hop (using retransmissions).
Don't forget that the mac layer is designed to be used by all sorts of traffic (UDP, TCP, IP, ARP, ...) and some of them expect from the mac layer to do its job (send the frame correctly to next hop).
Now, if you really want from the mac layer to don't care about UDP packets, I suggest you create a special QoS WifiMac with some adjustments (map udp traffic to some TID and then map that TID to some AC and then tweak the number of retransmission of that AC to 1)
Regards

Message has been deleted

Filip

unread,
Mar 9, 2022, 6:22:45 PM3/9/22
to ns-3-users
Thank you for explanation, now I understand.
 I try get maximum throughput for all standards, I try with RTS/CTS, without , set number of  retransmission to 2 (when number of retransmission is 1 I get 0 throughput), 2 sending stations, 3, 4, 10.... sending stations. 
I got this result :

standardy.png

But e.g. theoretical throughput 802.11ac is around 1.3 Gbps, so throughputs I got for standards are so low. I cant get higher throughput.
Can you help me what can be wrong ? I add my code to attachments.

Thank you very much for your advice in advance!

Best regards

Dátum: streda 9. marca 2022, čas: 6:29:39 UTC+1, odosielateľ: souliman...@gmail.com
standards.cc

Soulimane Mammar

unread,
Mar 13, 2022, 1:37:32 PM3/13/22
to ns-3-users
Hi,
Now I see what's your problem (you should said that from the beginning) 
If I'm not mistaken, you couldn't get the expected throughputs (for instance 1.3 Gbips for ac) and you suspected that the RTS/CTS mechanism was the cause.
RTS/CTS mechanism is used to protect large frames from collision (it's a little overhead to pay to get a big benefit). 
That being said, when it comes to a scenario with just two nodes (client and server), there will be no collision and hence you can eliminate the mechanism for good.
Now, how can we achieve a maximum throughput with 802.11 ac for instance ? You have to know that there are a couple of parameters to tweak to get there.
The Modulation Coding Scheme (MCS) index, the Channel Width used for transmission,  the usage (or not) of the Short Guard Interval (SGI) and the Number of Spatial Streams (NSS).
I wrote you a script (attached) to test all the combinations of these parameters
Regards 

test5.cc

Filip

unread,
Mar 13, 2022, 2:22:41 PM3/13/22
to ns-3-users
Hello, thank you very much  now I understand. I use only one spatial stream ,wrong MCS and I do not set wifi phy band. I see in your posted script  rssLossModel, how to choose this model correctly (I mean Friis, Log, cost231,threeLog, nakagami, okumuraHata .... )? 

In topic https://groups.google.com/g/ns-3-users/c/3-wunqjje74 I use different code. I try test problem on  examples/wireless/wifi-simple-hidden-ht-stations.cc (where originally is used 802.11b), I try to use 802.11ac and 802.11n, but for these standards I got same throughput with Rts/Cts on and off. When change standard to 802.11g it works like expect. I done some research if there is some other protection in 802.11ac/802.11n against hidden nodes , but could not find anything useful.

Thank you for any advice
Best regards


Dátum: nedeľa 13. marca 2022, čas: 18:37:32 UTC+1, odosielateľ: souliman...@gmail.com

Filip

unread,
Mar 17, 2022, 7:22:03 AM3/17/22
to ns-3-users
Hello, I added spatial streams, set correct MCS and channel width in my code and got similar throughput like from your script. But with when I checked MCS table for 802.11 ac there is for 3 spatial streams and 160 Mhz channel width 2106 bitrate with out SGI and 2340 with SGI.  I got from your code as well as mine around 1320 Mbit/s with 4 spatial streams. I know that throughput never be equal to bitrate, but  should not be this throughput higher with these parameters ?

Thank you in advance for answer
Best regards


Dátum: nedeľa 13. marca 2022, čas: 19:22:41 UTC+1, odosielateľ: Filip

Soulimane Mammar

unread,
Mar 18, 2022, 6:35:22 PM3/18/22
to ns-3-users
Hi,
As far as I know the combination of 3 NSS, 160MHZ and MCS9 is not valid
I don't know if ns3 enforces this fact or falls back to the closest acceptable combination (to be checked from source code)
Regards

Filip

unread,
Mar 18, 2022, 7:08:47 PM3/18/22
to ns-3-users
Hello thank you very much for reply.
In my code I use  MCS8, MCS9 is not avaible for 160 Mhz. I try  Constant rate wifi manager and ideal (same maximum throughput, but ideal is better for distance because of changing MCS). For every standrad that support MIMO i use 4 spatial streams, for 2,4 Ghz 40 Mhz channel and for 5 Ghz 160 Mhz, all with out SGI. But I think that the throughput is too low for these parameters. I add my outputs for standard to the attachments. I also add my code , please if you have time look at the settings for standards if this outputs are correct.

Thank you very much!
Best regards

Dátum: piatok 18. marca 2022, čas: 23:35:22 UTC+1, odosielateľ: souliman...@gmail.com
802.11b_maxThroughput.csv
802.11ax6_maxThroughput.csv
802.11ax5_maxThroughput.csv
code_standards.cc
802.11ac_maxThroughput.csv
802.11n2.4_maxThroughput.xlsx
802.11n5_maxThroughput.xlsx
802.11g_maxThroughput.csv
802.11a_maxThroughput.csv
802.11ax2.4_maxThroughput.csv
Reply all
Reply to author
Forward
0 new messages