diff -urw ns-2.26/mac/mac-802_11.cc ns-2.26-std/mac/mac-802_11.cc --- ns-2.26/mac/mac-802_11.cc 2003-10-10 09:56:53.000000000 -0700 +++ ns-2.26-std/mac/mac-802_11.cc 2003-10-10 10:24:53.000000000 -0700 @@ -302,6 +302,8 @@ return 0; if(nav_ > Scheduler::instance().clock()) return 0; + if(pcs_ > Scheduler::instance().clock()) + return 0; return 1; } @@ -366,7 +368,7 @@ (u_int32_t)ETHER_ADDR(mh->dh_sa) == \ (u_int32_t)index_ || (u_int32_t)ETHER_ADDR(mh->dh_da) == MAC_BROADCAST) { - drop(p); + drop(p, why); return; } break; @@ -1111,7 +1113,7 @@ * interface. * */ - + set_pcs(txtime(p)); /* * If the interface is currently in transmit mode, then * it probably won't even see this packet. However, the Only in ns-2.26-std/mac: mac-802_11.cc~ diff -urw ns-2.26/mac/mac-802_11.h ns-2.26-std/mac/mac-802_11.h --- ns-2.26/mac/mac-802_11.h 2003-02-26 14:08:56.000000000 -0800 +++ ns-2.26-std/mac/mac-802_11.h 2003-10-10 10:10:16.000000000 -0700 @@ -327,6 +327,13 @@ } } + inline void set_pcs(u_int16_t us) { + double now = Scheduler::instance().clock(); + double t = us * 1e-6; + if((now + t) > pcs_) + pcs_ = now + t; + } + protected: PHY_MIB *phymib_; MAC_MIB *macmib_; @@ -350,6 +357,7 @@ Internal MAC State ============================================================ */ double nav_; // Network Allocation Vector + double pcs_; // Physical Carrier Sense MacState rx_state_; // incoming state (MAC_RECV or MAC_IDLE) MacState tx_state_; // outgoint state