[Ns-developers] A possible bug in ns2, capture() function in mac-802_11.cc
Tom Henderson
tomh at tomh.org
Sun Oct 19 22:02:42 PDT 2008
Mayur wrote:
> Dear NS experts,
>
> There seems to be a BUG in ns2 (till latest version ns2.33) :
>
> _*Abstract: *_
>
> capture() function should treat errored_pkts and normal_pkts
> differently. Viz., the NAV should be set to only EIFS for errored
> packets and for normal packets to { EIFS + txtime(pkt) }.
>
> _*More elaboration :*_
>
> * When a sender is far such that the received power (Pr) is [
> RXThresh_ < Pr <= CSThresh_ ], the packet is sensed but bot
> understood. As per the 802.11 std, for such sensed_only packet the
> receiver node should wait for EIFS. In NS2 presently (till ns2.33)
> this is done so far as this is the only packet being received.
> (PHY makes the packet ERRORED and MAC sets NAV to EIFS. (see
> recv_timer() function.)
>
> * But when more than one packets are being received, (COLLISION or
> CAPTURE case) then, there (seems to be) is a bug in the code. viz.
> The capture() function always sets NAV to (EIFS + txtime(pkt)),
> without checking if the packet is marked with 'errored' or not.
>
>
> I have tried to rectify the bug (If I am correct). The corrected
> mac-802_11.cc is attached herewith. [Note: The original and modified
> versions can be toggled by just commenting/uncommenting the
> corresponding "#define" .]
>
> As observed I have modified the capture() function to take a second
> argument for if the pkt is errored and the function acts accordingly.
>
> Obviously, the mac-802_11.h needs one line correction for the new
> declaration of capture().
>
> The results in the two cases (original_capture and modified_capture) are
> drastically different depending upon the scenario being tested.
>
> Your suggestions are welcomed.
>
> regards,
> Mayur
>
I entered a new bug report in the ns-2 tracker:
https://sourceforge.net/tracker/index.php?func=detail&aid=2180792&group_id=149743&atid=775392
Are there any reviewers for this patch?
Thanks,
Tom
More information about the Ns-developers
mailing list