[ns] mhDefer_.start may be called before it is expire. 1st call in
Mac802_11::Send and 2nd call in Mac802_11::tx_resume(triggled
sekilauhk at yahoo.com.hk
Tue May 25 11:57:31 PDT 2004
I am programming ns2 for simulating an ad hoc network.
The data packet size in my ad hoc network can be very
large (512 byte to 1k byte) and may be very small 50
to 70 byte. For packet size less than 80 bytes,
RTS/CTS will be used for transmission.
I have a problem . The upper layer pass a large packet
(512 byte) to the mac layer. Mac802_11::send will be
call and in the moment it is called, the tx and rx is
idle. Therefore, mhDefer.start() will be called (for
starting the mhdefer timer. tx_active_ has not yet be
set.(because it has not yet gain the medium control).
Before the node gets the medium control ,other node
transmit a small size packet to this node.
Mac802_11::recv() will be called, mhRecv.start() is
called and timer started. After a short moment,
Mac802_11:recv() is called and then
Mac802_11::recvData is called and then tx_resume() is
called. In the Mac802_11::tx_resume(), the program
jumps into the 1st conditional check and mhDefer.start
will be called again.
The problem occured here: mhDefer is called before it
has expired. The 1st calling in inside Mac802_11::send
and large packet is being to send down. The second
called is setting the node to reply an acknowledement
SIFS after the small packet is sent.
Therefore, I have the following suggestion:
at Mac802_11::Recv(), when the 1st bit of the incoming
packet(from other node to this node) is "seen" by the
node, and in the meantime, if pktTx has been set and
mhDefer has been started and mhSend_ is idle, then we
should call mhDefer.stop to stop the timer. After the
rx_state has been set either to MAC_RECV or MAC_COL,
we call the mhBackoff.start(cw_,is_idle()); In this
case, the mhDefer that is started by Mac802_11::send()
will be cancel.
I would like to hear your comment on my changing.
Do You Yahoo!?
Get your free @yahoo.com.hk address at http://mail.english.yahoo.com.hk
More information about the Ns-users