[ns] TKN 802.11e segmentation fault

V.Toubiana v.toubiana at free.fr
Sat Apr 16 04:00:30 PDT 2005


Hi

I had the same problem when I change the original tcl file. 
The problem is in the mac-802_11e.cc file in the function "inc_retryCounter". If pktTx_[pri] is set to "0", the program segfault. One solution is tu check the value of "pktTx_[pri]" before using it. This solved my problem, hope it will help you.



Here the changed function :

bool Mac802_11e::inc_retryCounter(int pri) {
  u_int32_t *rcount, *thresh;
  if (pktTx_[pri]!=0) {
	struct hdr_cmn *ch = HDR_CMN(pktTx_[pri]);
	 if((u_int32_t) ch->size() <= macmib_->RTSThreshold) {
		ssrc_[pri]++;
		rcount = &ssrc_[pri];
		thresh = &macmib_->ShortRetryLimit;
	 }
	 else {
		slrc_[pri]++;
		rcount = &slrc_[pri];
		thresh = &macmib_->LongRetryLimit;
	}
  } 
  else {
		slrc_[pri]++;
		rcount = &slrc_[pri];
		thresh = &macmib_->LongRetryLimit;
  }
  if(*rcount > *thresh) {
    rtx_[pri] = 0;
    macmib_->FailedCount++;
    rst_cw(pri);
	if (pktTx_[pri]!=0) {
		discard(pktTx_[pri], DROP_MAC_RETRY_COUNT_EXCEEDED); pktTx_[pri] = 0;
	}
    *rcount = 0;
    return 1;
  } else
     return 0;
}

   Best regards

Vincent
>
>I have installed and run the TKN 802.11e model for ns-2.26.
>The script multi_udpflows.tcl works fine until I try to make the 
>simulation run for longer that 165 (see code below)
>My question is: does everybody get this error and has anyone got a 
>workaround or fix?
>Thanks in advance
>
>Joseph Johnson
>--------------------------------------------
>    $ns at 300.0 "$BS(0) reset";
>    $ns at 300.0 "$app stop"
>    $ns at 300.0 "$app1 stop"
>    $ns at 300.0 "$app2 stop"
>    $ns at 300.0 "$app3 stop"
>    #$ns at 10.0 "$ftp1 stop"
>    #$ns at 10.0 "$ftp2 stop"
>    $ns at 400.0 "puts \"NS EXITING...\" ; $ns halt"
>--------------------------------------------
>Further info:
>the simulation will run for a considerable amount of time before 
>producing the error so a longer value may be needed to reproduce the 
>error on high-powered workstations.
>
>ns 2.26
>Fedora Core 2 (also fails on 3 - compiled with gcc33)
>
>No errors occur if the mac layer is set to "mac/802_11" and the 
>interface queue to "CMUPriQueue"
>The simulation can run for longer periods by not starting some of 
>the applications (commenting out the "app start" command)
>
>



More information about the Ns-users mailing list