Wifi Collision Detection

508 views
Skip to first unread message

Sampath

unread,
Aug 12, 2017, 1:10:45 AM8/12/17
to ns-3-users
Hi Everyone,

I am trying to detect wifi packet collisions real-time (ex: every 1 second).
I have used TraceSources of WifiPhyStateHelper and WifiPhy.

I am wondering what PhyRxDrop mean? 
Is it the packet drops due to collisions only or does it account channel errors?
Any suggestion to count the number of collisions?

Thank you.
Best regards,
Sampath

Adil Alsuhaim

unread,
Aug 12, 2017, 7:00:40 AM8/12/17
to ns-3-users
Look at the NS3 DoxyGen documentation. It has a list of all trace soruces in one page. Basically, PhyRxDrop means:
  • Phy : happening at "Physical" layer, not Mac layer.
  • Rx : Reception of packet as opposed to Tx, which is Transmission of a packet.
  • Drop: discarded (I believe the other one where it is not dropped is called PhyRxOk
If you enable logging on YansWifiPhy you will see packet drops and why they were dropped.

Packets drop for different reasons. Maybe signal is too noisy or weak.

Keep in mind that in WIFI we do have something called CSMA-CA : Carrier-Sense Multiple Access with Collision Avoidance. Read about it. It uses Clear-to-send (CTS) and Request-to-Send RTS management packet to avoid collisions. I am not sure how your intended WIFI standard works in NS3, but just to be aware.

-Adil

Sampath

unread,
Aug 13, 2017, 6:23:38 AM8/13/17
to ns-3-users
Hi Adil,

Thanks for the information. I checked the TraceSources. They do not provide collision info. 
I found that the 'NotifyCollision' and 'RequestAccess' methods in DcaTxop and DcaManager classes can be manipulated to get the collision information.
I will dig deeper and see.
Thanks again.
Regards,
Sampath

Yalda Edalat

unread,
Nov 14, 2017, 3:48:08 PM11/14/17
to ns-3-users
Hi Sampath,

Any progress?

Sampath

unread,
Nov 14, 2017, 6:26:32 PM11/14/17
to ns-3-users
Hi Yalda,

I used the PHyRxDrop trace and made sure that channel is almost perfect (by using short distance, etc.).
Hope it helps.

Sampath

Yalda Edalat

unread,
Nov 16, 2017, 4:53:59 PM11/16/17
to ns-3-users
Could you please send me your code? I was wondering how to trace realtime.

Thanks

monikap...@gmail.com

unread,
Apr 15, 2021, 2:46:39 AM4/15/21
to ns-3-users
Hi Sampath,

I understand that it is  a very old discussion. Please try to reply if you are still active in this group.

I am trying to calculate collision probability in WiFi.
I was referring to https://groups.google.com/g/ns-3-users/c/7byjPHGIcmo , where it is suggested to go for
PhyRxError trace to get the number of collisons (assuming ideal channel conditions).

But here I see that you refer to PhyRxDrop trace to count the number of collisions.
It would be great if you can tell me the difference between PhyRxError and PhyRxDrop.
Which one accounts for collisions?

Thanks
Monika
PhD Research Fellow 

Sampath

unread,
Apr 16, 2021, 8:42:39 AM4/16/21
to ns-3-users
Hi Monika,

Yes, it has been a while and I do not remember all the little details. As far as I can see the wifi-phy-state-helper.cc class uses listeners to keep track of the yans-wifi-phy.cc packet drops. 

I think I used PhyRxOk, PhyStateRxOk, MacRxOk trace sources and their respective Tx sources to calculate the packet drops. Because I had a perfect channel. Drops had to be in the collisions. And I remember the values from Phy, PhyState and Mac usually tally, except for cases like packet aggregation. 

You can actually tap into the Phy can see the packet transmission times and see whether they are colliding. Interference-helper class should also be helpful (I suppose). 

Hope it helps. Feel free to get back to me if you need further info. 

Best regards,
Sampath

Reply all
Reply to author
Forward
0 new messages