Collisions in wifi

89 views
Skip to first unread message

PN

unread,
Aug 6, 2016, 7:54:37 PM8/6/16
to ns-3-users
I wanted to understand how collisions are handled in the wifi module in ns 3. I read the wifi documentation and went through some of the code in the src folder.

I had the following question:

If two packets say A and B collide (as in the image attached; image taken from the ns 3 website), does the receiver node drop only packet B or both A and B?

I'm asking this because while reading through the code in yans-wifi-phy.cc, I saw that  YansWifiPhy::StartReceivePacket() would drop packet B via the switch statement checking for state at the receiver. But I could not figure out how and if it would drop packet A as well.

Let me know if any of my understanding is wrong or if I'm looking in the wrong place.
Thanks.
Selection_009.png

Tommaso Pecorella

unread,
Aug 7, 2016, 5:36:31 AM8/7/16
to ns-3-users
Hi,

packet B will be dropped immediately, simply because it can not be decoded while another one is being received.
Packet A will be dropped if its SNR is too low (i.e., if the colliding packet did raise the noise enough to create errors in A).

Hope this helps,

T.

pdbarnes

unread,
Aug 7, 2016, 4:31:16 PM8/7/16
to ns-3-users
So even if B is higher S/N only A has a chance to be received, which is not realistic. I seem to recall Tom talking about fixing that, not sure where in development that is.

In other words, the behavior could change (for the better) in the near future.

Peter

Tom Henderson

unread,
Aug 7, 2016, 5:45:47 PM8/7/16
to ns-3-...@googlegroups.com
There is a patch pending to better model the capture effect:

https://www.nsnam.org/bugzilla/show_bug.cgi?id=2368

It will hopefully be added to mainline ns-3-dev after the ns-3.26 release.

- Tom

PN

unread,
Aug 18, 2016, 12:24:20 AM8/18/16
to ns-3-users
Thank you for your reply. I'm also trying to understand the entire path of the packet as it goes through the transmitter, channel and finally to the receiver in the wifi module and is passed up by the PHY to the higher layers.

Currently, I'm trying to find out how YansWifiPhy communicates with DcfManager and MacLow as shown in this architecture (https://www.nsnam.org/docs/models/html/wifi-design.html#wifi-architecture). I have two questions:

1. YansWifiPhy::EndReceive() has a call to m_rxOkCallback or m_rxErrorCallback via m_state. These callbacks seem to be set via WifiPhyStateHelper::SetReceiveOkCallback() and WifiPhyStateHelper::SetReceiveErrorCallback() respectively. But I couldn't figure out where these functions are called from and what functions do m_rxOkCallback and m_rxErrorCallback eventually lead the packet to in MacLow.

2. Also, I had a confusion in Wifi-phy-state-helper.cc class. YansWifiPhy calls WifiPhyStateHelper::SwitchToRx() which calls WifiPhyStateHelper::NotifyRxStart() which calls  WifiPhyListener::NotifyRxStart(). But I couldn't figure out where WifiPhyListener::NotifyRxStart() function was defined. In wifi-phy.cc its declared as a virtual function. I couldn't find where its actually defined.

If you could help me with these that would be a great help. Thanks.

pdbarnes

unread,
Aug 18, 2016, 4:01:52 AM8/18/16
to ns-3-users
For 2, read the end of the API docs:
https://www.nsnam.org/doxygen/classns3_1_1_wifi_phy_listener.html#af4c85874e4b351216c08ff90ca5c0e95

The part beginning "Implemented in..."
Peter

Reply all
Reply to author
Forward
0 new messages