Tuesday, September 20, 2011

NS2 Mobility Model

Mobility models

Node mobility in MIRACLE is ruled by two classes named BMPosition and GMPosition, derived from Position class. The former utilizes a Basic Movement (BM) model and the latter uses a Gauss-Markov (GM) model.
These models are those we provide with the MIRACLE release, but you can feel free to create your own!

The Basic Movement model moves nodes in uniform straightforward way. Nodes are moved by setting their destination by using the Tcl command setdest, which accepts as inputs the coordinates of the destination and the speed (in meters per second) of the node. The true position of the node is updated only when needed, e.g. when the destination is changed or a calculation (as freespace attenuation or upon a getPosition() call) is requested by an external module. In this model no control is added about borders of simulation field, so this means that a node, reached the setdest coordinates, will move in that direction and will not stop since a new destination is set.

The GMPosition Model is more complex than the previous one. In this case, nodes perform direction changes autonomously and a control of the behavior at borders is provided. Nodes adopting this mobility model requires mean direction (in radians) and a mean speed as inputs.
Speed and direction are calculated form mean values given as inputs multiplicating them by a random value, according to the following law (the law for direction is the same):

speed_ = (alpha_*speed_) + (((1.0-alpha_))*speedMean_) +
+ (sqrt(1.0-pow(alpha_,2.0))*Gaussian());

As could be seen, the current (in this case) speed is calculated from previous value of speed and the mean speed, given as input. The incidence of the mean value is controlled by the alpha parameter, which assumes values between 0 and 1. So the variations of speed are due to the ``old'' current speed and a random value provided by the Gaussian() function. It must be noticed that even if speedMean_ is 0, the current speed could be non-zero. As in the previous model, position update is calculated when needed, but in this case every step from previous update is computed (because a gaussian walk is made of several gaussian steps). The time resolution of each step is provided by the updateTime_ variable.

There are four different behaviors for nodes reaching boundaries. These are REBOUNCE, HARDWALL, SPHERIC and THOROIDAL. In the first case the node rebounces on the border line, it means that if at least one of the coordinates exceeds the x or y field width it will be carried back in the field by a value equal to the difference between the exceeding coordinate and the field maximal coordinate. For example, if the simulation field is 100 meters wide and the new coordinate is 102 meters, then rebounce algo will carry back coordinate to 98 which is 100 - (102 - 100).
The HARDWALL behavior expects that the node stops its movement at the border of the field, if trepassed. In case of SPHERIC behavior the node will be put on the other side of the field, like an overflow. In the last case, THOROIDAL, the node is put at the centre of the field.

Interface of two networks Ns2 Miracle

NS2 Miracle:

Here iam like to aware about ns2 miracle which connect two interface in the networks for wg if you want to connect the UMTS and VANET you can use this or any two interface can be connected by this ns2 miracle

MIRACLE is an extension for the ns2 simulator developed by the Department of Information Engineering at the University of Padova. The acronym stands for Multi InteRfAce Cross Layer Extension and describes one of its new capabilities intoduced by modularity. In fact, using MIRACLE you will be able to manage your nodes in a cross layer fashion and additionally multi technology support (whithin the same node) is provided.

The possibility of loading library dinamically has been introduced in standard ns2 simulator, starting from release 33. By now, we will suppose that you are using this simulator or a more recent one.

In MIRACLE every modification can constitute a stand alone library and can be loaded when necessary with the load command. In this case modifications could be rapidly intercharged, loading the appropriate library. Furtermore a modification of a library requires only to recompile the code associated to that library and it usually requires some seconds. So you can save memory space (you need only a ns2 distribution) and precious time for debugging and simulations.

A motivation for creating the MIRACLE Extension is to fill the gap between ns2 and the simulation of multi technology enviroments and provide the possibility of performing cross layer messaging. This is one of the most advanced field of research and an opportune instrument for simulation is needed. The way MIRACLE reached this goal is a generic and technology independent approach.

MIRACLE node is based on generic entities connected by each other. The protocol stack is implemented through entities called Modules. The novel idea consists in allowing presence of more than one Module per layer. Every Module is connected to another entity called Node Core. It goes off the layer ordering scheme and has the task of coordinating message exchange between modules. It also stores the node actual position in the simulation field in order to allow position-dependent calculations such those related to propagation and interference models.

There are also another kind of entities connected to the Node Core, called PlugIns. As Node Core, they don't depend on layer classification. Due to their independence from the OSI stack, the PlugIn may be exploited for node coordination functionalities (e.g., cognitive engines and multi interfaces manager) and cross layer intelligence.

Communication among different layers is provided by Service Access Points (SAP), accordingly to OSI structure. As in ns2, connections between Modules, NodeCore and PlugIns are made by Connectors, but the latter are completely reprojected to trace packets passing through them according to rules extablished by user.

Tuesday, June 21, 2011

Upscheduler using Ns2 in Wimax

Hi Ns2 followers,

Here like to share some article regarding the Wimax Upscheduling and downscheduling is ths latest article and some research is going on.

Here like to share in terms of Ns2 as well as in the Technial part share my experience incase if missed out or somw wrong excuse me.

The existing wimax scheduler( NIST) has the patch file can install in Ns2 to run the wimax . For the uplinking and downlinking some algorithms like Weighted Round Robin(WRR) as uplink scheduler,Deficit Round Robin (DRR) as downlink scheduler are the existing algorithms and interm of wimax static wimax is used to allocate the different Quality of service to allocate and to transfer from one location to another location.

Here iam attaching certain reference paper kindly look after it .

There are many VOIP channels avaliable to send the file from one to another end i mean source to destination.

[1] Deploying license-exempt wimax solutions. Technical
report, Intel, 2005.
[2] Considerations for deploying mobile wimax at various
frequencies. Technical report, Nortel, 2006.
[3] The design and implementation of wimax module for
ns-2 simulator.
http://ndsl.csie.cgu.edu.tw/wimax ns2.php,
September 2007.
[4] The network simulator ns-2.
http://www.isi.edu/nsnam/ns/, September 2007.
[5] Seamless and secure mobility.
September 2007.
[6] C. F. Ball, F. Treml, X. Gaube, and A. Klein.
Performance analysis of temporary removal scheduling
applied to mobile wimax scenarios in tight frequency
reuse. European Transactions on Telecommunications,
2(16):888{894, September 2005.

Sunday, May 22, 2011

Public Key in NS2 (Cryptography)

Public Key in Ns2

HI everybody here like to brief or just info about the Public Key infrastructure (Pki). Public Key is one of the method for cryptography using digital certificates used to transfer the data safe and securely. Explains how is done in Ns2.General explanation follows

Public-key cryptography requires that entities that want to communicate in a secure manner, possess certain security credentials. This collection of security credentials is stored in a wallet. Security credentials consist of a public/private key pair, a "user" certificate, a certificate chain, and "trusted" certificates.
The secrecy of encrypted data generally depends on the existence of a secret key shared between the communicating parties. Providing and distributing such secret keys is one aspect of key management. In a multiuser environment, secure key distribution may be difficult; public key cryptography was invented to solve this problem.

Public key cryptography is based on a secure secret key pair. Each key (one half of the pair) can only decrypt information encrypted by its corresponding key (the other half of the pair). A key pair includes:
• The private key, known only to its owner
• The public key, distributed widely, but still associated with its owner
Use of the cryptographic key pair to set up a secure, encrypted channel ensures the privacy of a message and validates the authenticity of the sender of the message. It also provides an important benefit: the ability to widely distribute the public key on a server, or in a central directory, without jeopardizing the integrity of the private key component of the key pair. This eliminates the need to transmit the public key to every correspondent in the system.
Each entity that participates in a public key system must have a public/private key pair. The public key for an entity is published by a certificate authority (CA) in a user certificate. Then, other entities that want to send it secure information can encrypt the information with the recipient entity's public key. Another use for a public key is for an entity that receives a communication to validate the sender's organizational affiliation.

Main Useful of Public Key

The PKI approach to security does not take the place of all other security technologies; rather, it is an alternative means of achieving security. The following advantages of PKI have led to its emergence as an industry standard for securing Internet and e-commerce applications.

• PKI is a standards-based technology.

• It allows the choice of trust provider.

• It is highly scalable. Users maintain their own certificates, and certificate authentication involves exchange of data between client and server only. This means that no third party authentication server needs to be online. There is thus no limit to the number of users who can be supported using PKI.

• PKI allows delegated trust. That is, a user who has obtained a certificate from a recognized and trusted certificate authority can authenticate himself to a server the very first time he connects to that server, without having previously been registered with the system.

• Although PKI is not notably a single sign-on service, it can be implemented in such a way as to enable single sign-on.
A certificate authority (CA) is a trusted third party that certifies that other entities--users, databases, administrators, clients, servers--are who they say they are. When it certifies a user, the certificate authority verifies the user's identity and grants a certificate, signing it with the certificate authority's private key. The certificate authority has its own certificate and public key, which it publishes, as well as a private key, which is securely maintained. Servers and clients use the CA's root certificate to verify signatures that the certificate authority has made. A certificate authority might be an external company that offers certificate services, or an internal organization such as a corporate MIS department
Public certificates

A certificate is like an electronic passport that proves the identity of a user or device that seeks to access the network. The certificate ensures that the entity's information is correct and that the public key actually belongs to that entity. A certificate is created when an entity's public key is signed by a trusted identity (a certificate authority). It contains information such as the following:
• the certificate user's name
• an expiration date
• a unique serial number assigned to the certificate by the CA
• the user's public key
• information about the rights and uses associated with the certificate
• the name of the certificate authority that issued the certificate
• the CA's signature
• an algorithm identifier that identifies which algorithm was used to sign the certificate

A trusted certificate, sometimes known as a root key certificate, typically belongs to a third party entity that is trusted to issue certificates. It is obtained in a secure manner and, operationally, does not need to be validated for its authenticity each time it is accessed because it is self-signed. A client or a server can validate that an entity is who it claims to be by verifying that the entity's certificate was issued by a known and trusted certificate authority.
Typically, certificate authorities whom you trust issue the user certificates. Oracle provides several default trusted certificates, so users do not have to install their own. These trusted certificates also enable servers to perform SSL authentication to clients who have wallets containing only trusted certificates.

Friday, May 13, 2011

Synopsis of NS2

Hi Students

Here like to discuss few points in NS2

1) Ns2 is the nice tool using for research and study purpose.
2) Mostly Ns2 is made up of C++
3) Even other language like Java, Dot net can also use only with separate patches
4) Flexible language but difficult to get materials and datas
5) Excellent tool for network engineers research people

Enjoy learning NS2

Tuesday, April 5, 2011

Sample Coding in Wireless

Here Guys this is an sample tcl coding

# Define options
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 50 ;# number of mobilenodes
set val(rp) DSDV ;# routing protocol
set val(x) 1000 ;# X dimension of topography
set val(y) 1000 ;# Y dimension of topography
set val(stop) 150 ;# time of simulation end

set ns [new Simulator]
set tracefd [open simple.tr w]
set namtrace [open simwrls.nam w]

$ns trace-all $tracefd
$ns namtrace-all-wireless $namtrace $val(x) $val(y)

# set up topography object
set topo [new Topography]

$topo load_flatgrid $val(x) $val(y)

create-god $val(nn)

# configure the nodes
$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 ON \
-macTrace OFF \
-movementTrace ON

for {set i 0} {$i < $val(nn) } { incr i } {
set n($i) [$ns node]

# Provide initial location of mobilenodes
$n(0) set X_ 347.0
$n(0) set Y_ 3.0
$n(0) set Z_ 0.0

$n(1) set X_ 345.0
$n(1) set Y_ 36.0
$n(1) set Z_ 0.0

$n(2) set X_ 330.0
$n(2) set Y_ 121.0
$n(2) set Z_ 0.0

$n(3) set X_ 316.0
$n(3) set Y_ 152.0
$n(3) set Z_ 0.0

$n(4) set X_ 246.0
$n(4) set Y_ 90.0
$n(4) set Z_ 0.0

$n(5) set X_ 379.0
$n(5) set Y_ 6.0
$n(5) set Z_ 0.0

# Set a TCP connection between n(1) and n(31)
set tcp [new Agent/TCP/Newreno]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns attach-agent $n(1) $tcp
$ns attach-agent $n(31) $sink
$ns connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns at 10.0 "$ftp start"

# Set a TCP connection between n(31) and n(43)
set tcp [new Agent/TCP/Newreno]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns attach-agent $n(31) $tcp
$ns attach-agent $n(43) $sink
$ns connect $tcp $sink

#defining heads
$ns at 0.0 "$n(0) label CH"
$ns at 0.0 "$n(1) label Source"
#$ns at 0.0 "$n(2) label N2"

$ns at 10.0 "$n(5) setdest 785.0 228.0 5.0"
$ns at 13.0 "$n(26) setdest 700.0 20.0 5.0"
$ns at 15.0 "$n(14) setdest 115.0 85.0 5.0"

#Color change while moving from one group to another
$ns at 73.0 "$n(2) delete-mark N2"
$ns at 73.0 "$n(2) add-mark N2 pink circle"
$ns at 124.0 "$n(11) delete-mark N11"
$ns at 124.0 "$n(11) add-mark N11 purple circle"
$ns at 103.0 "$n(5) delete-mark N5"
$ns at 103.0 "$n(5) add-mark N5 white circle"
$ns at 87.0 "$n(26) delete-mark N26"
$ns at 87.0 "$n(26) add-mark N26 yellow circle"
$ns at 92.0 "$n(14) delete-mark N14"
$ns at 92.0 "$n(14) add-mark N14 green circle"

# Define node initial position in nam
for {set i 0} {$i < $val(nn)} { incr i } {
# 20 defines the node size for nam
$ns initial_node_pos $n($i) 20

# Telling nodes when the simulation ends
for {set i 0} {$i < $val(nn) } { incr i } {
$ns at $val(stop) "$n($i) reset";

# ending nam and the simulation
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "stop"
$ns at 150.01 "puts \"end simulation\" ; $ns halt"
proc stop {} {
global ns tracefd namtrace
$ns flush-trace
close $tracefd
close $namtrace
exec nam simwrls.nam &

$ns run