NS2 Notebook: Multi-channel Multi-interface Simulation in NS2 (2.29)

Back to Index


6. Modifications in mac/mac-802_11.cc

 

// Multi-channel Multi-interface
#define NUM_NICS 5

int
Mac802_11::command(int argc, const char*const* argv)
{

  ......

  cache_node_count_ = atoi(argv[2])*NUM_NICS;

  ......

}

 

void
Mac802_11::recv_timer()
{

  ......

  /*
  * IEEE 802.11 specs, section 9.2.5.6
  * - update the NAV (Network Allocation Vector)
  */

  //Multi-channel Multi-interface
  /* original
  if(dst != (u_int32_t)index_) {
  set_nav(mh->dh_duration);
  }
  */


  if((dst/NUM_NICS) != (u_int32_t)(index_/NUM_NICS)) {
  set_nav(mh->dh_duration);
  }

  ......

   /*
  * Address Filtering
  */

  //Multi-channel Multi-interface
  /*original
  //if(dst != (u_int32_t)index_ && dst != MAC_BROADCAST) {
  */


  if(((dst/NUM_NICS) != (u_int32_t)(index_/NUM_NICS)) && dst != MAC_BROADCAST) {

  ......

}

 

 
© Copyright 2008. All rights reserved. Powered by Free Site Templates