[ns] [bug] Problem in mac-802_11.cc which will cause unnecessary DROP_MAC_RETRY_COUNT_EXCEE

Shihong Zou hoyli@bupt.edu.cn
Wed Dec 10 21:45:55 2003


[Bug Report]

-----------------------------
Category:  Other
Package:   ns ns2.26
OS:        WindowsXP+cygwin
Environment Variables:
LD_LIBRARY_PATH=
TCL_LIBRARY=
TK_LIBRARY=


-----------------------------
Description:

Description of Problem:
  I think there is a problem in mac-802_11.cc which will cause unnecessary DROP_MAC_RETRY_COUNT_EXCEEDED.
  This problem is caused by the mistake in Mac802_11::recvACK(Packet *p), which can not reset the "ssrc_" and "slrc_" properly because  "ch->size()" is the size of ACK frame, not the DATA frame.
  I moidify the Mac802_11::recvACK(Packet *p) as the following, and it works well:
void
Mac802_11::recvACK(Packet *p)
{
	
	//struct hdr_cmn *ch = HDR_CMN(p);
	struct hdr_cmn *ch = HDR_CMN(pktTx_);//modified by zoushh
	if(tx_state_ != MAC_SEND) {
	discard(p, DROP_MAC_INVALID_STATE);
	return;
	}
	//printf("(%d)...................recving ACK:%x\n",index_,p);
	
	/*
	 * The successful reception of this ACK packet implies
	 * that our DATA transmission was successful.  Hence,
	 * we can reset the Short/Long Retry Count and the CW.
	 */
	if((u_int32_t) ch->size() >= macmib_->RTSThreshold)
		ssrc_ = 0;
	else
		slrc_ = 0;
	assert(pktTx_);
	Packet::free(pktTx_); pktTx_ = 0;

	mhSend_.stop();
         ......(omitted, remain the same)
}
  You can test it with a simple script, which has only three nodes in WLAN.With the origin code, it will cause DROP_MAC_RETRY_COUNT_EXCEEDED frequently, which is not possible for correct DCF.
  What do you think about it? am i right? 
  Wish your reply, thanks!