26
Figure 4 shows basic structure of ns-2. The network topology and traffic
agents etc are specified in the TCL file. It is parsed by the oTCL interpreter. The
C++ library has all the implementation details. When ns-2 is run, the
resulting data
could be obtained in a trace file format. The trace file contains time stamp and
information about each packet that is sent, received or dropped. It also has
information
about the packet size, type of packet etc. A base station and a subscriber
station can be set up as a node in ns-2. As the number of nodes in the simulation
increase, the packets that are sent and received increases. This makes the trace file
very large. To aide in extracting the right
data out from the file, a PERL script was
written, details of which are provided later.
In case of the Chang Gung University simulation, there was no concept of a
base station for a particular node. However the WiMAX
forum simulator had the
distinction between nodes. While setting up the node, it could be classified as a base
station as opposed to a subscriber node. Thus it was decided to use the simulator
from WiMAX forum.
Version 2.31 of ns-2 and Version 2.1 of the
WiMAX module from NIST was
used. The WiMAX module simulates both physical (PHY) and MAC layers based on
IEEE 802.16e standard.
After setting up ns-2 and compiling the WiMAX module it was discovered
that there were several memory leaks in the simulation. For a single node the
simulation would run properly
but as the nodes increased, so would the packet traffic.
This would eventually cause the simulation to stop to run as it would run out of
27
dynamic memory necessary to allocate new packets. Several memory leak issues
were fixed during the course of experimentation, to make the simulation useful.
These issues and fixes were reported back to the WiMAX forum.
As
mentioned earlier, simulation scenario for ns-2 is defined by a Tcl script.
This file contains all the information needed to run the simulation. In a typical
model, the nodes in the network are setup, starting with the base station. The mobile
nodes are created and associated with the base station they belong to at the start. A
traffic agent is created and is attached to the source node.
An example of a traffic
agent could be a CBR traffic agent. On the top of the traffic agent, an application
which generating required traffic created. There is a sink node created and attached
to the base station using a wired connection. This sink
node is just to accept the
incoming packet. The focus of the study will be the path between the mobile node
and the base station.
Do'stlaringiz bilan baham: