Professional Documents
Culture Documents
1 BM19 MCA15 Furkhan
1 BM19 MCA15 Furkhan
INTRODUCTION
Ubuntu is a Linux distribution based on Debian and mostly composed of free and open-
source software. Ubuntu is officially released in three editions: Desktop, Server, and Core for
Internet of things devices and robots. All the editions can run on the computer alone, or in a
virtual machine.
NS2 is an open-source simulation tool that runs on Linux. It is a discreet event simulator
targeted at networking research and provides substantial support for simulation of routing,
multicast protocols and IP protocols, such as UDP, TCP, RTP and SRM over wired and
wireless (local and satellite) networks.
1) 1. Implement the working of User Datagram Protocol (UDP)traffic between two nodes with
Constant Bit Rate (CBR)Create two nodes which are connected through a point-topoint link with a
CBR traffic using the UDP. Set and display the details of the following parameters and identity the
same in the trace file:
a. Duplex Link
b. Packet size
c. Bandwidth of the link
d. Time of Simulation
#Experiment for sending UDP traffic.
# nodes are connected as n1-->n2
#Print CBR packet size and interval puts "CBR Packet Size =
[$cbr set packet_size_]" puts "CBR Rate = [$cbr set rate_]"
puts "CBR Interval = [$cbr set interval_]" puts "CBR Max
Pkts = [$cbr set maxpkts_]" puts "CBR Random Behaviour
= [$cbr set random_]"
The eleventh field is the network layer protocol’s packet sequence number.
The last field shows the unique id of packet.
PROGRAM 3: Consider a scenario with consists of three nodes point-to-point network with duplex links
between them. Set the queue size, vary the bandwidth, and find the number of packets dropped.
Program 4:
Implement the ping application for a 6 nodes communication. The communication set
is as follows:
• Build topology shown in the figure 1
• Fix the node positions
• Let the bandwidth (BW) of all the links except the one between C and D
be 1 Mbps
• Let the link bandwidth between C and D be 1.5 Mbps
• Propagation delay of all links be 1ms
• Let the queue size be 3
•Packet size be 750 bytes
• Send Ping traffic from A to E one packet every 7 ms
• Send UDP traffic from B to F one packet every 7ms
Program 4:
#Create a simulator object
set ns [new Simulator]
#Define different colors for data flows (for NAM)
$ns color 1 Red
#$ns color 2 Blue
#Open the NAM trace file
set nf [open pingn.nam w]
$ns namtrace-all $nf
set nt [open pingn.tr w]
$ns trace-all $nt
#Define a 'finish' procedure
proc finish { } {
global ns nf nt
$ns flush-trace
close $nf
close $nt
exec xgraph file11.dat
exec xgraph PACKETS DROPPED -x TIME -y
exit 0
}
#Create 6 Nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
$ns duplex-link $n0 $n2 1Mb 1ms DropTail
$ns duplex-link $n1 $n2 1Mb 1ms DropTail
$ns duplex-link $n2 $n3 1.5Mb 1ms DropTail
$ns duplex-link $n3 $n4 1Mb 1ms DropTail
$ns duplex-link $n3 $n5 1Mb 1ms DropTail
#Set Queue Size of link (n1-n2) to 3
$ns queue-limit $n0 $n2 3
$ns queue-limit $n1 $n2 3
$ns queue-limit $n3 $n4 3
#Create two ping agents and attach them to the nodes n0,n2,n3 and n4
set p0 [new Agent/Ping]
$ns attach-agent $n0 $p0
#Schedule events
$ns at 0.2 "$p0 send"
$ns at 0.4 "$p0 send"
$ns at 0.6 "$p0 send"
$ns at 0.8 "$p0 send"
$ns at 1.0 "$p0 send"
$ns at 1.2 "$p0 send"
$ns at 1.4 "$p0 send"
$ns at 1.6 "$p0 send"
$ns at 2.0 "$p0 send"
$ns at 2.5 "$p0 send"
$ns at 3.5 "$p0 send"
#Generate UDP traffic
set udps [new Agent/UDP]
set udpi [new Agent/UDP]
set udpr [new Agent/Null]
$ns attach-agent $n0 $udps
$ns attach-agent $n4 $udpr
$udps set fid_ 1
#Setup a CBR over UDP connection
set cbr [new Application/Traffic/CBR]
$cbr set packet_size_ 4000
$cbr set interval_ 7ms
$cbr attach-agent $udps
$ns connect $udps $udpr
#Schedule events for the CBR and FTP agents
$ns at 1.1 "$cbr start"
$ns at 3.0 "$cbr stop"
#Print CBR packet size and interval
puts "CBR Packet Size = [$cbr set packet_size_]"
puts "CBR Rate = [$cbr set rate_]"
puts "CBR Interval = [$cbr set interval_]"
puts "CBR Max Pkts = [$cbr set maxpkts_]"
puts "CBR Random Behaviour = [$cbr set random_]"
Awk File
BEGIN{
pingDrop=0;
time=0;
}
{
if( $1 == "d")
{
time= $2;
printf(" %d %f \n",pingDrop,time);
pingDrop++;
}
}
END {
printf("");
}
Program 5
Simulate the communication between the mobile nodes using wireless
medium adapting the Ad Hoc Distance Vector (AODV) protocol in ns-2.
#
# Create God
#
create-god $val(nn)
#
# Create the specified number of mobilenodes [$val(nn)] and "attach" them
# to the channel.
# Here two nodes are created : node(0) and node(1)
# configure node
$ns_ node-config \
-addressingType flat \
-adhocRouting DSDV \
-llType LL \
-macType Mac/802_11 \
-ifqType Queue/DropTail/PriQueue \
-ifqLen 50 \
-antType Antenna/OmniAntenna \
-propType Propagation/TwoRayGround \
-phyType Phy/WirelessPhy \
-channelType Channel/WirelessChannel \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace ON
for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 1 ;# disable random motion
}
#
# Provide initial (X,Y, for now Z=0) co-ordinates for mobilenodes
#
$node_(0) set X_ 5.0
$node_(0) set Y_ 5.0
#$node_(0) set Z_ 0.0
$node_(1) set X_ 400.0
$node_(1) set Y_ 400.0
close $tracefd
close $namtrace
}
puts "Starting Simulation..."
$ns_ run
Program 6
Simulate the working of the Distance Vector Routing algorithm for a
wired network in ns-2
Gephi( 0.9.2)
Gephi is an open-source software for network visualization and analysis. It helps data
analysts to intuitively reveal patterns and trends, highlight outliers and tells stories
with their
data. It uses a 3D render engine to display large graphs in real-time and to speed up
the
exploration. Gephi combines built-in functionalities and flexible architecture to:
Explore
Analyse
Spatialize
Filter
Cluster
Manipulate
Export all types of networks.
Gephi is based on a visualize-and-manipulate paradigm which allow any user to
discover
networks and data properties. Moreover, it is designed to follow the chain of a case
study,
from data file to nice printable maps.
Gephi is a free/libre software distributed under the GPL 3 ("GNU General
Public License").
Tags: network, network science, infovis, visualization, visual analytics, exploratory
data
analysis, graph, graph viz, graph theory, complex network, software, open source,
science
Features
Gephi is a tool for data analysts and scientists keen to explore and understand graphs.
Like
Photoshop™ but for graph data, the user interacts with the representation,
manipulate the
structures, shapes and colors to reveal hidden patterns. The goal is to help data
analysts to
make hypothesis, intuitively discover patterns, isolate structure singularities or faults
during
data sourcing. It is a complementary tool to traditional statistics, as visual thinking
with
7. Work on network visualization tool – Gephi to visualize the following data sets:
* Astro physics dataset
* Fiction novel dataset - Les Miserable
* Dolphin dataset
* Create your dataset and visualize using Gephi.
Les Miserable:
Dolphin dataset