This page is no longer being maintained. Up-to-date information can be found at http://icawww1.epfl.ch/uwb/ns-2.html.

Ultra-wide band MAC and PHY layer for ns-2

Note that the UWB MAC and PHY only work with ns-2.26. Due to changes in the 802.11 implementation (mainly the PHY_MIB and MAC_MIB) it will not work with version 2.27 or newer.

For simulations with preconfigured routes instead of an ad-hoc routing agent (like DSR, AODV, ...) you might want to add the NOAH agent to your ns-2.26. Note that you should add NOAH after applying the TCL patches for UWB given below.

Step-by-step installation instructions for ns-2.26

Makefile.in Add mobile/mod_codedppm.o mobile/propagation-tarokh.o mac/mac-ifcontrol.o mac/interference-phy.o \ to OBJ_CC
common/packet.h Add the MAC_IFControl packet header
line 59: #define HDR_MAC_IFControl(p) (hdr_mac_ifcontrol::access(p))
line 122: PT_MAC_IFControl,
line 209: name_[PT_MAC_IFControl]= "MACIFControl";
tcl/lan/ns-mac.tcl Add the MAC/IFControl default values
# MAC IFControl settings
if [TclObject is-class Mac/IFControl] {
	Mac/IFControl set delay_ 64us
	Mac/IFControl set ifs_ 16us
	Mac/IFControl set slotTime_ 16us
	Mac/IFControl set cwmin_ 16
	Mac/IFControl set cwmax_ 1024
	Mac/IFControl set rtxLimit_ 16
	Mac/IFControl set bssId_ -1
	Mac/IFControl set sifs_ 8us
	Mac/IFControl set pifs_ 12us
	Mac/IFControl set difs_ 16us
	Mac/IFControl set rtxAckLimit_ 1
	Mac/IFControl set rtxRtsLimit_ 3
        Mac/IFControl set RTSThreshold 0
        Mac/IFControl set fixed_code -1 ; # dynamic coding
}
tcl/lib/ns-default.tcl
tcl/lib/ns-lib.tcl
tcl/lib/ns-mobilenode.tcl
tcl/lib/ns-packet.tcl
These require changes in many places in the files:
  1. Add default values for the physical layer and the propagation model to ns-default.tcl
  2. Make the modulation module part of the node object ns-lib.tcl and ns-mobilenode.tcl
  3. Add the MAC IFControl packet header to ns-packet.tcl
We therefore provide a patch. Download patch.tcl.lib to the main ns-2 directory (ns-2.26) and call patch -Np0 < patch.tcl.lib.
mobile/modulation.h
mobile/modulation.cc
replace the old modulation.{h,cc} (which didn't provide any functionality and were not used)
mobile/mod_codedppm.h
mobile/mod_codedppm.cc
mobile/ppm.cc
add mobile/mod_codedppm.{h,cc} which provide the calculation of the bit error rate given PPM modulation and a channel code and the BER function table mobile/ppm.cc
mobile/propagation-tarokh.h
mobile/propagation-tarokh.cc
add the UWB propagation model
mac/interference-phy.h
mac/interference-phy.cc
add the new UWB physical layer
mac/mac-ifcontrol.h
mac/mac-ifcontrol.cc
add the new UWB MAC layer
mac/phy.h replace void recv(Packet* p, Handler* h); by virtual void recv(Packet* p, Handler* h);
mac/wireless-phy.h replace
	void sendDown(Packet *p);
	int sendUp(Packet *p);
by
	virtual void sendDown(Packet *p);
	virtual int sendUp(Packet *p);
and move
	EnergyModel* em() { return node()->energy_model(); }
	inline int initialized() {
		return (node_ && uptarget_ && downtarget_ && propagation_);
	}
from the private to the protected section.

Change log

25 Mai 2004 original version
04 June 2004 small bug fix: wrong assert in mac-ifcontrol.cc set_ths() when used without REQ/RESP