ns-bsd.tar.gz (2.3 MB): contains the simulation code, the files to be changed in the ns-2.1b8a distribution, reference output data, and analysis code and figures.
ns-bsd_including_ns.tar.gz (53.8 MB): also contains the complete modified version of ns-allinone-2.1b8a.
ns-2 has been modified to model a mobile client communicating with an access point over a wireless link using a power-saving mode (PSM) protocol. The model is meant to represent the IEEE 802.11 wireless LAN protocol for infrastructure (not ad-hoc) networks. The model can be configured to simulate the standard 802.11 PSM protocol, or the Bounded Slowdown (BSD) protocol. For more details on BSD, please refer to: Minimizing Energy for Wireless Web Access with Bounded Slowdown.
The implementation models the wireless link protocol at an abstract level and does not model the medium access control (MAC) protocol in detail; for example, it does not model wireless signal strength, channel contention, node movement, or multicast. It is meant to be used only for simulations where such details are not important.
This code was developed for a specific project, it was not designed as a configurable simulation platform. As such, using the model for other purposes may or may not be convenient.
A wireless link supporting PSM is modeled using an OTcl object called a PSLink.
/ns-2.1b8a_changes/ contains the ns-2.1b8a C++ files which were changed to support the wireless link model.
Minimal changes were made to the ns-2 code to enable PSLink. Sleep mode for the wireless link is simulated by deactivating the queue elements of the link so that they do not forward any packets, and waking up simply entails activating the queues. queue.cc was modified to support sleep and wakeup. While it is sleeping, the queue object calls the caught-sleeping-alert function in the queue's corresponding OTcl object if a new packet arrives. The PSM determines when the link should sleep and wakeup based in part on the activity on the link. In delay.cc, the delay element of a link was modified to call the idle-alert function in the link's corresponding OTcl object when the link starts or stops sending data.
/mobile-http/ contains OTcl code to implement a PSLink, and simulate Web traffic over a wireless link,
/mobile-http/pslink.tcl contains the implementation of PSLink. A PSLink
transforms a basic duplex-link (which contains two sets of queue and link
elements) between a mobile device node and an access point node
into a link which models a PSM. It contains handlers for the notification
functions from the queue and link C++ objects mentioned above. The link is
awakened whenever the mobile device has data to send (in
caught-sleeping-alert). Once the link goes inactive (in idle-alert), it will
be put to sleep immediately if the stay_alive option is not enabled. If
stay_alive is enabled, a timer is used to put the link to sleep after a given
period of time. Beaconing is implemented using a timer which expires every
beacon_period. The listen_interval parameter determines how frequently the
mobile device listens to the beacons. If it does listen to the beacon, and
there is data buffered in the queue for the mobile device, then the link is
awakened. The listen_interval parameter can change dynamically based on the
chosen listen_interval_func. To model the basic 802.11 PSM, a PSLink should
be instantiated with the options:
-stayalive 0 -listen_interval_func li_null -beacon_period_ms 100
These are also the defaults if not given. To model BSD-50% with a maximum sleep duration of 900ms, PSLink should be instantiated with:
-stayalive 0.2 -listen_interval_func li_percent -listen_interval_percent 50 -listen_interval_max 8
PSLink outputs to the file specified by pslink_tr the total sleep time, total awake time, and number of beacons listened to.
/mobile-http/http.tcl generates network traffic to simulate Web browsing. It is based on the code contributed to ns-2 by Giao Nguyen: ns-2.1b8a/tcl/http/http.tcl. The original model uses one-way TCP connections, but it has been updated to use FullTCP connections. The model generates traffic using randomized parameters based on Bruce Mah's study published in INFOCOM '97: "An Empirical Model of HTTP Network Traffic". http.tcl generates trace files of the randomized parameters used, and the page retrieval times. It also prints the page retrieval times to the screen during simulation.
/mobile-http/cdf_data/ contains the distributions for the HTTP traffic parameters. HttpServerTime.cdf has been added based on the UC Berkeley Home IP dialup service traces as described in the BSD paper. HttpThinkTime.1000.cdf limits the think time to 1000 seconds.
/mobile-http/mobile-http.tcl is the main simulation program. It sets up a mobile device and access point connected by a PSLink, and uses the HTTP model to generate network traffic for the simulation. The bs_delay parameter is the one-way latency between the access point and the server.
/mobile-http/tests.txt is a list of tests to evaluate no-PSM, PSM-static (the 802.11 PSM), BSD-100%, BSD-50%, BSD-20%, and BSD-10% for server RTTs of 10ms, 20ms, 40ms, and 80ms. The tests simulate the retrieval of 10,000 web pages. The link (ln) commands at the end of tests.txt are necessary for the matlab analysis programs.
/mobile-http/data/ is the reference output data for the tests. Since all the tests use the same random variables, redundant trace files have been deleted.
/mobile-http/analysis/ contains 3 matlab programs to analyze the data and produce the figures provided in /mobile-http/analysis/figs/. analyze_e_all.m uses the awake_power, sleep_power, and listen_energy parameters to model energy consumption as described in the BSD paper.
Copyright (c) 2002 Massachusetts Institute of Technology, All rights reserved.
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without written agreement is hereby granted, provided that the above copyright notice and the following two paragraphs appear in all copies of this software.
IN NO EVENT SHALL THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Code contributed by Ronny Krashinsky, firstname.lastname@example.org, http://www.cag.lcs.mit.edu/~ronny