Академический Документы
Профессиональный Документы
Культура Документы
Subject:
Code :
Er.No. :
PATEL JAY C
ME SEM-II
WMC
2720501
140870705004
Aim:
Show that if n=4, a cell can be split into four smaller cells, each with half the radius and 1/16 of the
transmitter power of the original cell. If the extensive measurements show that the path loss exponent
is 3, how should the transmitter power be changed in order to split a cell into four smaller cells? What
impact will this have on the cellular geometry? Explain your answer and provide drawings that show
how the new cells would fit within the original macrocells.
Solution:
Let, R be the original radius of the cell before it is splitted; Pt1 its transmitted power and Pr
be the received power at the boundary.
Now, let the cell be splitted with the radius half the original cell; then, it will be divided
into 4 cells. This is illustrated in the diagram.
Original Cell
a
R
a/2
R/2
R
Pr New cell boundry Pt 2
2
where Pt1 and Pt2 are the transmit powers of the larger and smaller cell base stations, respectively, and
n is the path loss exponent.
pt 2
pt1
2n
If we take n = 4 and set the received powers equal to each other, then
pt 2
pt1
16
In other words, the transmit power must be reduced by 12 dB in order to fill in the original coverage
area with microcells, while maintaining the S/I requirement.
Assuming Square Cell, we can show that when cell radius is made half, its area will be splitted into 4
equal parts.
And when path loss component n = 3,
pt 2
pt1
8
In other words, for n=3,the transmit power must be reduced by 9 dB in order to fill in the original
coverage area with microcells, while maintaining the S/I requirement.
Aim:
Solution:
Aim:
Analyze any wireless network of your choice using different routing algorithms covered in
syllabus using NS-2 .
Solution:
through the interpreter; these objects are instantiated within the interpreter, and are closely
mirrored by a corresponding object in the compiled hierarchy. The interpreted class hierarchy
is automatically established through methods defined in the class TclClass. user instantiated
objects are mirrored through methods defined in the class TclObject. There are other
hierarchies in the C++ code and OTcl scripts; these other hierarchies are not mirrored in the
manner of TclObject.
Ad Hoc Networking:
A wireless ad hoc network is a decentralized wireless network. The network is ad hoc
because it does not rely on a pre-existing infrastructure, such as routers in wired networks or
access points in managed (infrastructure) wireless networks. Instead, each node participates
in routing by forwarding data for other nodes, and so the determination of which nodes
forward data is made dynamically based on the network connectivity. The earliest wireless ad
hoc networks were the "packet radio" networks (PRNETs) from the 1970s, sponsored by
DARPA after the ALOHAnet project.
The decentralized nature of wireless ad hoc networks makes them suitable for a
variety of applications where central nodes can't be relied on, and may improve the scalability
of wireless ad hoc networks compared to wireless managed networks, though theoretical and
practical limits to the overall capacity of such networks have been identified. Minimal
configuration and quick deployment make ad hoc networks suitable for emergency situations
like natural disasters or military conflicts. The presence of a dynamic and adaptive routing
protocol will enable ad hoc networks to be formed quickly.
In most wireless ad hoc networks the nodes compete to access the shared wireless
medium, often resulting in collisions. Using cooperative wireless communications improves
immunity to interference by having the destination node combine self-interference and othernode interference to improve decoding of the desired signal.
Wireless ad hoc networks can be further classified by their application:
* mobile ad hoc networks (MANETs)
* wireless mesh networks
* wireless sensor networks.
mesh routers may be highly mobile. Often the mesh routers are not limited in terms of
resources compared to other nodes in the network and thus can be exploited to perform more
resource intensive functions. In this way, the wireless mesh network differs from an ad-hoc
network since all of these nodes are often constrained by resources.
Wireless mesh architecture is a first step towards providing high-bandwidth network
over a specific coverage area. Wireless mesh architectures infrastructure is, in effect, a router
network minus the cabling between nodes. It's built of peer radio devices that don't have to be
cabled to a wired port like traditional WLAN access points (AP) do. Mesh architecture
sustains signal strength by breaking long distances into a series of shorter hops. The
intermediate nodes, not only boost the signal but cooperatively make forwarding decisions
based on their knowledge of the network, i.e. performs routing. Such an architecture may,
with careful design, provide high bandwidth, spectral efficiency, and economic advantage
over the coverage area.
Example of three types of wireless mesh network:
* Infrastructure wireless mesh networks: Mesh routers form an infrastructure for clients.
* Client wireless mesh networks: Client nodes constitute the actual network to perform
routing and configuration functionalities.
* Hybrid wireless mesh networks: Mesh clients can perform mesh functions with other
mesh clients as well as accessing the network.
Wireless mesh network have a relatively stable topology except for the occasional
failure of nodes or addition of new nodes. The traffic, being aggregated from a large number
of end users, changes infrequently. Practically all the traffic in an infrastructure mesh
network is either forwarded to or from a gateway, while in ad hoc networks or client mesh
networks the traffic flows between arbitrary pairs of nodes.
This type of infrastructure can be decentralized (with no central server) or centrally
managed (with a central server), both are relatively inexpensive, and very reliable and
resilient, as each node needs only transmit as far as the next node. Nodes act as routers to
transmit data from nearby nodes to peers that are too far away to reach in a single hop,
resulting in a network that can span larger distances. The topology of a mesh network is also
more reliable, as each node is connected to several other nodes. If one node drops out of the
network, due to hardware failure or any other reason, its neighbors can find another route
using a routing protocol.
* Unattended operation
* Node capacity is scalable,only limited by bandwidth of gateway node.
Sensor nodes can be imagined as small computers, extremely basic in terms of their
interfaces and their components. They usually consist of a processing unit with limited
computational power and limited memory, sensors (including specific conditioning circuitry),
a communication device (usually radio transceivers or alternatively optical), and a power
source usually in the form of a battery. Other possible inclusions are energy harvesting
modules, secondary ASICs, and possibly secondary communication devices (e.g. RS-232 or
USB).
The base stations are one or more distinguished components of the WSN with much
more computational, energy and communication resources. They act as a gateway between
sensor nodes and the end user.
Routing Protocols:
The four ad-hoc routing protocols that are currently supported are Destination
Sequence Distance Vector (DSDV), Dynamic Source Routing (DSR), Temporally ordered
Routing Algorithm (TORA) and Adhoc On-demand Distance Vector (AODV). The old APIs
for creating a mobilenode depended on which routing protocol was used.
From the topology, a basic idea of the network to be simulated is obtained. For that topology,
the node-config parameters are set first. This is shown below.
$ns
node-config
-adhocRouting
$val(rp) \
-llType
$val(ll) \
-macType
$val(mac) \
-ifqType
$val(ifq) \
-ifqLen
$val(ifqlen) \
-antType
$val(ant) \
-propType
$val(prop) \
-phyType
$val(netif) \
-channelType
$val(chan) \
-topoInstance
$topo \
-agentTrace
ON \
-routerTrace
OFF \
-macTrace
OFF \
-movementTrace
OFF
After setting the node configuration parameters, the actual nodes are created. The code for
creating nodes is given below.
for { set j 0 } { $j < $val(nn)} {incr j} {
set node_($j) [ $ns_ node ]
$node_($i) random-motion 0 ;# disable random motion
}
At $time sec, the node would start moving from its initial position of (x1,y1) towards
a destination (x2,y2) at the defined speed. In this method the node-movement-updates are
triggered whenever the position of the node at a given time is required to be known. This may
be triggered by a query from a neighbouring node seeking to know the distance between
them, or the setdest directive described above that changes the direction and speed of the
node.
Topology Definition:
Irrespective of themethods used to generate nodemovement, the topography for
mobilenodes needs to be defined. It should be defined before creating mobilenodes. Normally
flat topology is created by specifying the length and width of the topography using the
following primitive:
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
Link:
A link is another major compound object in NS. When a user creates a link using a
duplex-link member function of a Simulator object, two simplex links in both directions are
created.
The output queue of a node is actually implemented as a part of simplex link object.
Packets dequeued from a queue are passed to the Delay object that simulates the link delay,
and packets dropped at a queue are sent to a Null Agent and are freed there. Finally, the TTL
object calculates Time To Live parameters for each packet received and updates the TTL
field of the packet.
Tracing:
In NS, network activities are traced around simplex links. If the simulator is directed to
trace network activities (specified using $ns trace-all file or $ns namtrace-all file), the links
created after the command will have the following trace objects. Users can also specifically
create a trace object of type type between the given src and dstnodes using the create-trace
{type file src dst} command.
When each inserted trace object (i.e. EnqT, DeqT, DrpT and RecvT) receives a
packet, it writes to the specified trace file without consuming any simulation time, and passes
the packet to the next network object.
Packet:
A NS packet is composed of a stack of headers, and an optional data space. A packet header
format is initialized when a Simulator object is created, where a stack of all registered (or possibly
useable) headers, such as the common header that is commonly used by any objects as needed, IP
header, TCP header, RTP header (UDP uses RTP header) and trace header, is defined, and the offset
of each header in the stack is recorded.
Usually, a packet only has the header stack (and a data space pointer that is null).
Although a packet can carry actual data (from an application) by allocating a data space, very
few application and agent implementations support this. This is because it is meaningless to
carry data around in a non-real-time simulation. However, if you want to implement an
application that talks to another application cross the network, you might want to use this
feature with a little modification in the underlying agent implementation. Another possible
approach would be creating a new header for the application and modifying the underlying
agent to write data received from the application to the new header.
Commands at a Glance:
Following is a list of commands used in wireless simulations:
$ns_ node-config -addressingType <usually flat or hierarchical used for
wireless topologies>
-adhocRouting <adhoc rotuing protocol like DSDV, DSR,
-llType <LinkLayer>
-macType <MAC type like Mac/802_11>
-propType <Propagation model like
Propagation/TwoRayGround>
-ifqType <interface queue type like
Queue/DropTail/PriQueue>
-ifqLen <interface queue length like 50>
-phyType <network inteface type like
Phy/WirelessPhy>
-antType <antenna type like Antenna/OmniAntenna>
-channelType <Channel type like Channel/WirelessChannel>
-topoInstance <the topography instance>
-wiredRouting <turning wired routing ON or OFF>
-mobileIP <setting the flag for mobileIP ON or OFF>
-energyModel <EnergyModel type>
-initialEnergy <specified in Joules>
-rxPower <specified in W>
-txPower <specified in W>
-agentTrace <tracing at agent level turned ON or OFF>
-routerTrace <tracing at router level turned ON or OFF>
-macTrace <tracing at mac level turned ON or OFF>
-movementTrace <mobilenode movement logging turned
ON or OFF>
Link Layer
The LL used by mobilenode is same as described in Chapter 14. The only difference being
the link layer for mobilenode, has an ARP module connected to it which resolves all IP to
hardware (Mac) address conversions. Normally for all outgoing (into the channel) packets,
the packets are handed down to the LL by the Routing Agent. The LL hands down packets to
the interface queue. For all incoming packets (out of the channel), the mac layer hands up
packets to the LL which is then handed off at the node_entry_ point.
ARP
The Address Resolution Protocol (implemented in BSD style) module receives queries from
Link layer. If ARP has the hardware address for destination, it writes it into the mac header of
the packet. Otherwise it broadcasts an ARP query, and caches the packet temporarily. For
each unknown destination hardware address, there is a buffer for a single packet. Incase
additional packets to the same destination is sent to ARP, the earlier buffered packet is
dropped. Once the hardware address of a packets next hop is known, the packet is inserted
into the interface queue. The class ARPTable is implemented in ~ns/arp.{cc,h} and
~ns/tcl/lib/ns-mobilenode.tcl.
Interface Queue
The class PriQueue is implemented as a priority queuewhich gives priority to routing rotocol
packets, inserting them at the head of the queue. It supports running a filter over all packets in
the queue and removes those with a specified destination address. See ~ns/priqueue.{cc,h}
for interface queue implementation.
Mac Layer
Historically, ns-2 (prior to release ns-2.33) has used the implementation of IEEE 802.11
distributed coordination function (DCF) from CMU. Starting with ns-2.33, several 802.11
implementations are available.
Tap Agents
Agents that subclass themselves as class Tap defined in mac.h can register themselves with
the mac object using method installTap(). If the particular Mac protocol permits it, the tap
will promiscuously be given all packets received by the mac layer, before address filtering is
done.
Network Interfaces
The Network Interphase layer serves as a hardware interface which is used by mobilenode to
access thechannel. The wireless shared media interface is implemented as class
Phy/WirelessPhy. This interface subject to collisions and the radio propagation model
receives packets transmitted by other node interfaces to the channel. The interface stamps
each transmitted packet with the meta-data related to the transmitting interface like the
transmission power, wavelength etc. This meta-data in pkt header is used by the propagation
model in receiving network interface to determine if the packet has minimum power to be
received and/or captured and/or detected (carrier sense) by the receiving node. The model
approximates the DSSS radio interface (LucentWaveLan direct-sequence spread-spectrum).
Antenna
An omni-directional antenna having unity gain is used by mobilenodes.
2. The new keyword is used to create a new object reference to a particular class, as
shown below.
set ns [new Simulator]
3. The open keyword is used to open a file in the given r/w/x mode. If that particular
file does not exist, it is created and opened, as shown below.
set tf [open wireless.tr w]
4. The trace-all function is used to trace the events in the opened trace file (*.tr).
5. The namtrace-all-wireless function is to trace the events in the nam file created
(*.nam).
6. The load_flatgrid function is used to load the topography value of the simulation,
like 1000 x 1000, as shown below.
$topo load_flatgrid 1000 1000
Application
starts at 0.5 sec
Node
(x, y, z)
10
(500, 900, 0)
50
(500, 100, 0)
Configurtion Parameters:
Channel Type : Wireless Channel
Radio propagation model : TwoRay Ground
Network Interface type : Wireless Phy
MAC Type : 802-11
Interface Queue Type : PriQueue
LinkLayer type : LL
Antenna model : Omni Antenna
Max. Pts in ifq : 50
No. of mobile nodes : 3
Routing Protocol : DSDV
Procedure
1. Initialize the network configuration parameters of the network to be simulated
using the 'set' keyword and the 'val()' keyword.
2. While initializing, the super class of the particular class is also denoted. The
example of an initialization is
set val(chan) Channel/WirelessChannel
3. The values of link layer type, interface queue length, the number of nodes and the
4. Create an object (say, ns) for the Simulator class using the 'set' keyword, and 'new'
keyword.
set ns [new Simulator]
5. Create and open a trace file with write mode (i.e., w) using 'set' and 'open'
keywords.
set tf [open wireless.tr w]
6. Using the 'trace-all' function, set the ns object to trace all the events and write the
trace file created.
7. Create a nam file in write mode and using 'namtrace-all-wireless' function, with
arguments as the nam file handler and the topography values (here, 1000 x 1000),
the events traceds are put in nam file.
8. Create an object for the Topography class and give the values (1000 x 1000) in the
load_flatgrid' function.
9. Pass the value of the number of nodes to the 'create-god' function.
10. Set the values for the arguments of the 'node-config' function with all the
configuration parameter values.
11. Create the nodes 0, 1 and 2 using the 'set' and '$ns' keywords shown.
set node0 [$ns node]
12. Set the position of the nodes in the X_, Y_ and Z_ variables using 'set' keyword.
13. Create the TCP agent and attach it to node0 using the 'attach-agent' function.
14. Similarly create the object for FTP Application and attach it to the TCP object
Program
set val(chan) Channel/WirelessChannel
set val(prop) Propagation/TwoRayGround
set val(netif) Phy/WirelessPhy
set val(mac) Mac/802_11
set val(ifq) Queue/DropTail/PriQueue
set val(ll) LL
Output