Wifi Channel Access

134 views
Skip to first unread message

Gaurang Naik

unread,
Nov 19, 2015, 6:29:31 AM11/19/15
to ns-3-users
Hi,

My question is related to how channel access occurs in WiFi (more related to the protocol itself than ns3), and what I am observing in simulations. I am simulating a scenario where there are two sets of nodes (two transmitter-receiver pairs) in the network. The transmitter in set A as well as set B generate 1 packet each at t=0.1 second. From what I understand, priority is given to channel access using SIFS. So whichever set of nodes has lower SIFS gets access to the channel first. So, if set A has SIFS=9ns, and set B has SIFS=10ns, then set A gets access to the channel first, and then set B. This is what I observe in simulations as well.

Now suppose, the transmitter in set A generates 100 packets, all at t=0.1 seconds. The transmitter in set B generates 1 packet at t=0.1 second. And if SIFS of A=9ns, SIFS of B=10ns, I am wondering what should happen? I am expecting that each time set A transmitter should be favored. So it gains access to the channel first and transmits the first packet. And then after it finished the first packet transmission, it gains access to the channel again. This way, transmitter B will get access to the channel only after transmitter A transmits all 100 packets. This is, however, not what I see in simulations. Transmitter A first sends a packet, and then transmitter B gets access to the channel. Am I missing something?

Any help is really appreciated. 

Thanks,
Gaurang.



Bo Zhang

unread,
Nov 19, 2015, 6:59:20 AM11/19/15
to ns-3-...@googlegroups.com
Hi,

In my understanding, SIFS is not used for media contention.

Cited from the book "802.11 the definitive guide":

"Short interframe space (SIFS)
The SIFS is used for the highest-priority transmissions, such as RTS/CTS frames and positive acknowledgments. High-priority transmissions can begin once the
SIFS has elapsed. Once these high-priority transmissions begin, the medium becomes busy, so frames transmitted after the SIFS has elapsed have priority over
frames that can be transmitted only after longer intervals."

One can only transmit immediately after SIFS if its sending a high-priority frame (normally only the ACK frame).

On the other hand, DIFS + contention window is for media contention. Cited from the same book:

"DCF interframe space (DIFS)
The DIFS is the minimum medium idle time for contention-based services. Stations may have immediate access to the medium if it has been free for a period longer than the DIFS." 

"After frame transmission has completed and the DIFS has elapsed, stations may attempt to transmit congestion-based data. A period called the contention window or backoff
window follows the DIFS. This window is divided into slots. Slot length is medium dependent; higher-speed physical layers use shorter slot times. Stations pick a random
slot and wait for that slot before attempting to access the medium; all slots are equally likely selections. When several stations are attempting to transmit, the station that picks
the first slot (the station with the lowest random number) wins."

So a normal data frame can only be sent after the medium is free for at least DIFS time. Then if first attempt is failed, a random number (call it t) in terms of # slots is drawn from an exponentially increasing contention window (*2 on each attampt). 

Then the node will listen the channel, if a slot is free, t is decreased by 1; otherwise t remains unchanged. When t is reduced to 0, a further DIFS is waited. If after DIFS the media is still free, then a 2nd attempt is performed; otherwise, the node doubles the contention window, draws a random number, and restarts the contention process. 

As a result, there is no guarantee who will get the medium access next.

Not sure if I'm entirely correct though.

Best
Zhang Bo


-- 
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.




--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Sebastien Deronne

unread,
Nov 19, 2015, 7:12:37 AM11/19/15
to ns-3-users
SIFS in nanoseconds? I am sorry but it is totally wrong, SIFS has a standard value and is expressed in microseconds.
Also, the way you see how the protocol behaves is not correct.

I suggest that you seriously start by reading books about how 802.11 works.
The purpose here is not to explain what books can teach to you, so please start with that.
Reply all
Reply to author
Forward
0 new messages