ns-2 Project Report
by Patrick Carpenter
April 26, 2011
Note: This is an abbreviated version of the report.
The full report, all simulation and data-processing scripts,
and summarized output data can be downloaded from this site
by clicking on the appropriate link:
report.pdf,
scripts.tar.gz,
data.ods.
Overview & Introduction
The purpose of this report is to recommend either a wired
or wireless network configuration to be implemented on a
school campus. To make an informed recommendation,
the ns-2 network simulation tool was used to measure
long-term, end-to-end throughput under a variety of scenarios
and compare the relative performance of both options. Measures
derived from throughput - such as efficiency, link-utilization
and fairness - were also considered.
The wired configuration consists of a chain of six hosts and
six routers, where each host is connected directly to one
router and the routers are connected in a chain (See
Figure 1). The bandwidth and propagation delay of each
of the eleven links are 1.5 Mbps and 5 ms, respectively.
The Wired Configuration

Figure 1: The Wired configuration.
The wireless configuration consists of six hosts arranged in
a straight line, where the distance between adjacent hosts is
fixed at 150 m (see Figure 2).
The Wireless Configuration

Figure 2: The Wireless configuration.
Method & Analysis
Three sets of experiments were used to evaluate the performance of the
wired and wireless configurations:
- Experiment Set A: This set of experiments is designed to
measure the throughput achieved between five pairs of nodes -
{(1, 2), (1, 3), (1, 4), (1, 5), (1, 6)} - when no other
connetions are competing for resources. The results of this
set of experiments can be useful for putting an empirical upper bound on
the throughput which can be achieved over a certain number of hops.
- Experiment Set B: This set of experiments is designed to
measure the throughput achieved between five pairs of nodes -
{(1, 2), (1, 3), (1, 4), (1, 5), (1, 6)} - under varying degrees
of competition for resources. Specifically, a connection is
established between the pair of nodes (3, 4) that runs concurrently
with the other connections. The results of this set of experiments
are interesting in that they give some idea of how one connection can
interfere with, or influence, the performance of other connections.
- Experiment set C: This set of experiments is designed to
measure the throughput achieved by three concurrent connections
between the pairs of nodes {(1, 6), (2, 5), (3, 4)}. The results of
this set of experiments are interesting since they show performance
under a somewhat realistic scenario. Since there are meaningful
connections active simultaneously, fairness - in terms of the
evenness of the distribution of resources - can also be derived.
In each case, the steady-state, end-to-end throughput is taken as
the preferred measure of performance. There are at least a few
reasons for this choice:
- Packet loss, efficiency, and other measures of performance are
generally only important inasmuch as they affect the end-to-end
throughput (i.e., other measures are not generally visible).
- Other visible measures (such as delay) may unfairly penalize
one configuration or the other. This is also why we consider
only the steady-state throughput.
- The metric is easy to measure, easy to understand and important
to actual users. Moreover, comparing the throughput of multiple
competing connections can be used to gauge other meaningful
criteria, such as fairness.
Experiments are conducted via simulation using the ns-2 network simulation
tool. Trace files are post-processed using scripts which count the number
of packets successfully delivered each second, and these data are analyzed
to determine time-varying connection throughput for each scenario.
Results & Conclusions
Figures 3, 5 and 7 show the time-varying throughput of
the Wired configuration for experiment sets A, B and C, respectively.
Figures 4, 6 and 8 show the same for the Wireless connection.
In general, the Wired configuration leads to more stable and evenly-distributed
throughput with better scalability and efficiency and lower latency, whereas the
Wired configuration leads to an overall higher steady-state throughput in many
cases.
Bandwidth vs Time

Figure 3: Results for Wired Connection, Set A
Bandwidth vs Time

Figure 4: Results for Wireless Connection, Set A
In the above figures, we see that the Wireless configuration leads to better
steady-state throughput for connections involving fewer than three hops, and that
the Wired configuration performs better for connections involving more hops. Note
also the delay in the Wireless configuration, and the inversely-proportional
relationship between steady-state throughput and the number of hops.
Bandwidth vs Time

Figure 5: Results for Wired Connection, Set B
Bandwidth vs Time

Figure 6: Results for Wireless Connection, Set B
In the above figures, we see that the Wireless configuration leads to distinct
levels of throughput depending on the connection; the level of throughput
is correlated to the degree of interference by the (3, 4) connection. The
long-term, end-to-end throughput is reached quite quickly in any event. By
comparison, the Wireless configuration leads to noticeable delays for connections
requiring more than one hop, and the long-term throughput is reached over a
much longer period of time. Also, the peak throughput of connections under
the Wireless configuration is affected regardless of the connection (in the
Wired configuration, connections which avoid interference are not affected).
Bandwidth vs Time

Figure 7: Results for Wired Connection, Set C
Bandwidth vs Time

Figure 8: Results for Wireless Connection, Set C
In the above figures, we notice the closeness of the achieved throughput by the
three connections under the Wired configuration, and the comparatively more
distant throughputs under the Wireless configuration. This is an indication of
a higher degree of fairness achieved by the Wired configuration in evenly
distributing resources across competing connections.
Recommendation
After collecting and analyzing simulation data, it is this
author's recommendation that the wired configuration be
selected for use in this case. Some of the major factors
which led to this decision are:
- The Wireless configuration demonstrates less scalability,
and does not outperform the Wired configuration by as
much as could be hoped for by a so much more modern
technology.
- The Wireless configuration leads to a much less equitable,
or fair, distribution of communication bandwidth among
competing connections than does the Wired configuration.
- The fact that the hosts do not move negates one of the
most compelling reasons for adopting wireless technology;
without mobility, wireless technology is almost universally
inferior (in terms of reliability and security, at least)
to equivalent wired technology.
Given the inferred usage of this network by a broad and
uncoordinated segment of the student body, and under the
assumption that most users care more about consistency than
peak achievable performance, and looking into future expansion
of the system, the Wired configuration emerges as the
winner. Note that if peak and average throughput were the only
criteria, the Wireless configuration should be chosen. That being
said, comparing 802.11b (with a peak rate of 11 Mbps) and a wired
connection of 1.5 Mbps capacity isn't necessarily a fair comparison,
in the sense that the disparity in channel capacity is almost an
order of magnitude. If the Wired configuration's channel bandwidth
increased even by a factor of two (2), given the results of this
simulation, it seems clear that a Wired solution would win on all
counts.
References & Acknowledgments
The simulations were developed using
Mark Greis's tutorial
as a guide and reference.
Joshua Robinson's article
was also used to determine some options for the wireless
protocol to make the simulation as realistic as possible.