You are on page 1of 39

INDEX

List of Experiments

1. Writing a TCL Script to create two nodes and links between nodes
2. Writing a TCL Script to transmit data between nodes
3. Evaluate the performance of various LAN Topologies
4. Evaluate the performance of Drop Tail and RED queue management schemes
5. Evaluate the performance of CBQ and FQ Scheduling Mechanisms
6. Evaluate the performance of TCP and UDP Protocols
7. Evaluate the performance of TCP, New Reno and Vegas
8. Evaluate the performance of AODV and DSR routing protocols
9. Evaluate the performance of AODV and DSDV routing protocols
10. Evaluate the performance of IEEE 802.11 and IEEE 802.15.4
11. Evaluate the performance of IEEE 802.11 and SMAC
12. Capturing and Analysis of TCP and IP Packets
13. Simulation and Analysis of ICMP and IGMP Packets
14. Analyze the Protocols SCTP, ARP, NetBIOS, IPX VINES
15. Analysis of HTTP, DNS and DHCP Protocols

Major Equipment Required: Required software (Open Source) like NS-2, NSG-2.1 and
Wire SHARK
Note:
A. Minimum of 12 Experiments have to be conducted B. All the Experiments may
be Conducted using Network Simulation software like NS-2, NSG-2.1 and Wire
SHARK/equivalent software. Note: For Experiments 2 to 10 Performance may be
evaluated through simulation by using the parameters Throughput, Packet
Delivery Ratio, Delay etc.
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual

What is a TCL script:

A Tcl script is a string that is a sequence of commands, separated by newlines or


semicolons. ...
The first word is the name of the command, the other words are passed to it as its
arguments. In Tcl, "everything is a command" - even what in other languages would be
called declaration, definition, or control structure.

How do I run a TCL script:

To run Tcl scripts from the Tcl Scripts dialog box, follow these steps:
1. On the Project menu, click Add/Remove Files in Project.
2. On the Files page of the Settings dialog box, add the Tcl script to your project.
3. On the Tools menu, click Tcl Scripts.
4. Under Libraries, select the script, and then click Run.

How do I write a TCL script in Linux:

Tcl Hello World Example: How To Write, Compile and Execute Tcl Program
on Linux OS
1. Write a Hello World Tcl Program. Create the helloworld program using the Vim
editor as shown below. ...
2. Make sure Tcl interpreter is installed on your system. ...
3. Execute Tcl Program.

How do I run a TCL script in Windows:

On the View menu, point to Utility Windows, and then click Tcl Console. On the
Project menu, click Generate Tcl File for Project. In the Tcl Script File name box, type
the name and path for the script. To automatically open the file in the Quartus II Text
Editor after generation, turn on Open generated file.
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-I
Writing a TCL Script to create two nodes and links between nodes

Number of nodes (3) is fixed in the program. Nodes are configured with specific
parameters of a mobile wireless node. After creating the nam file and trace file, we set
up topography object. set node_ ($i) [$ns node] is used to create the nodes. Initial
location of the nodes is fixed. Specific X, Y coordinates are assigned to every node.
Nodes are given mobility with fixed speed and fixed destination location. Here we set
the initial size for the every node by using initial_node_pos. AODV routing protocol is
used here. $val(stop) specifies the end time of the simulation. TCP agent is attached to
node_ (0). TCPSink agent is attached to node_(1). Both the agents are connected and
FTP application is attached to TCP agent. Now communication set up for node_(0) and
node_(1) is established. Similarly communication between node_(1) and node_(2) is
established.

File name: “wireless1.tcl”

#-------Event scheduler object creation--------#

set ns [new Simulator]


#creating trace file and nam
file
set tracefd [open wireless1.tr w]
set windowVsTime2 [open win.tr
w]
set namtrace [open wireless1.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) 3


III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
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 node_($i) [$ns node]
}

# Provide initial location of mobilenodes


$node_(0) set X_ 5.0
$node_(0) set Y_ 5.0
$node_(0) set Z_ 0.0

$node_(1) set X_ 490.0


$node_(1) set Y_ 285.0
$node_(1) set Z_ 0.0

$node_(2) set X_ 150.0


$node_(2) set Y_ 240.0
$node_(2) set Z_ 0.0

# Generation of movements
$ns at 10.0 "$node_(0) setdest 250.0 250.0 3.0"
$ns at 15.0 "$node_(1) setdest 45.0 285.0 5.0"
$ns at 19.0 "$node_(2) setdest 480.0 300.0 5.0"

# Set a TCP connection between node_(0) and node_(1)


set tcp [new Agent/TCP/Newreno]
$tcp set class_ 2
set sink [new Agent/TCPSink]

4
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
$ns attach-agent $node_(0) $tcp
$ns attach-agent $node_(1) $sink
$ns connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns at 10.0 "$ftp start"

set tcp [new Agent/TCP/Newreno]


$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns attach-agent $node_(1) $tcp
$ns attach-agent $node_(2) $sink
$ns connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns at 10.0 "$ftp start"

# Printing the window size


proc plotWindow {tcpSource
file} { global ns
set time 0.01
set now [$ns now]
set cwnd [$tcpSource set cwnd_]
puts $file "$now $cwnd"
$ns at [expr $now+$time] "plotWindow $tcpSource $file" }
$ns at 10.0 "plotWindow $tcp $windowVsTime2"

# Define node initial position in


nam for {set i 0} {$i < $val(nn)}
{ incr i } { # 30 defines the node
size for nam
$ns initial_node_pos $node_($i) 30
}

# Telling nodes when the simulation


ends for {set i 0} {$i < $val(nn) } { incr
i}{
$ns at $val(stop) "$node_($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
5
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
$ns flush-trace
close $tracefd
close $namtrace
exec nam simwrls.nam &
}

$ns run
# How to run the program:

$ns wireless1.tcl

#snapshot of the program:


III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
6
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-II
Writing a TCL Script to transmit data between nodes
Description
In a wireless network, nodes communicate using the communication model that consists
of TCP agent, TCPSink agent, and FTP application. The sender node is attached to the
TCP agent while the receiver node is attached to the TCPSink agent. The connection
between TCP agent and TCPSink agent is established using the keyword “connect”.
Transport agent (TCP) and application (FTP) are connected using the keyword “attach-
agent”. TCP agent sends data to TCPSink agent. On receiving the data packet, TCPSink
agent sends the acknowledgement to the TCP agent that in turn processes the
acknowledgements and adjusts the data transmission rate. The lost packets interpreted
as a sign of congestion. The tcl script in sample5.tcl demonstrates the communication
between the nodes using TCP protocol.

Sample Code:
#Filename: sample5.tcl
TCP (Transmission Control Protocol) and FTP (File Transfer
Protocol) ************#
#*****defining Communication between node0 and node1 **********#
# Defining a transport agent for sending
set tcp [new Agent/TCP]
# Attaching transport agent to sender node
$ns attach-agent $node_(0) $tcp
# Defining a transport agent for receiving
set sink [new Agent/TCPSink]
# Attaching transport agent to receiver node
$ns attach-agent $node_(1) $sink
#Connecting sending and receiving transport agents
$ns connect $tcp $sink
#Defining Application instance
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
set ftp [new Application/FTP]
# Attaching transport agent to application agent
$ftp attach-agent $tcp
# data packet generation starting time
$ns at 1.0 "$ftp start"
# data packet generation ending time
$ns at 6.0 "$ftp stop"

8
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-III
Evaluate the performance of various LAN Topologies
INTRODUCTION
A Computer Network is the group of computers connected together to share resources.The resource
can be hardware or software, if it is hardware example is printer shared between number of
computers and if it is software example can be application program shared between number of
clients.To design the computer network the important component are sender who generates the
information, receiver who receives the information, link that connects between two stations,
information which travels on link e.g. image, audio, text, video etc , and protocol which is set of
rules defined for successful communication.

NETWORK TOPOLOGY
It is the way in which number of computers connected together to share information or it is
geometric representation of number of computers connected together.
Types Of Network Topology
1. Star Topology:
It is the topology in which number of devices are connected to the central hub by point-to-point
link i.e. dedicated link between each device.In star topology, all the cables run from the
computer to central location where they are connected by a device called Hub.Hub is a device for
connecting multiple Ethernet devices together and making them act as single network.If one
device wants to send data to another ,it sends the data to the Hub , which then sends that data to
all other devices.This is the most common type of topology used in offices, computer labs.
Advantages-
 Easy to install & reconfigure
 Easy troubleshooting
 Failure of any node does not affect system
Disadvantages-
 Failure of hub affects whole system
 Each device requires its own cable
2. Ring Topology:
It is the topology in which each computer is connected to the next computer, with last one
connected to the first computer in circular fashion. When any device wants to send data , then
data is passed along the ring in one direction , from device to device, until it reaches its
destination. In ring topology, each device consist of repeater which regenerates the bits and
passes them along. Ring topology are used in high performance networks where large bandwidth
is necessary.
Advantages-
 Easy to find cable failure
 To add and remove device requires changing only two connections

Disadvantages-
 Failure of one computer affects whole network
 Unidirectional traffic

3. Bus Topology:
It is the topology in which one long cable acts as a backbone to link all the devices in a network.
In bus topology , multiple devices aare connected one by one by means of single cable called as
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
bus. Nodes are connected to the bus cable by drop lines and taps. A drop line is a connection
running between the device and the main cable. A tap is a connector that either splices into main
cable to create a contact with the metallic core.
When any computer wants to send data to other computer, then it will send that data
to bus first, all the computers on the network receives the information but only destination
node accepts it and all other reject that information.
Advantages-
 Easy to install
 Easy to use
 Low cost
Disadvantages-
 Difficult to troubleshot bus topology
 Heavy network traffic can slow down bus
 Failure of cable affects all devices

4. Mesh Topology:
It is the topology in which every device has a dedicated point-to-point link to every other
device. The term dedicated means that the link carries traffic only between the two devices it
connects.
Here Node 1 must be connected to n-1 nodes, Node 2 must be connected to n-1 nodes, finally
node n must be connected to n-1 nodes. Therefore for mesh topology we need n(n-1)/2
duplex mode lines.
Advantages-
 Privacy and security
 Easy fault identification & fault
isolation Disadvantages-
 Difficult to install
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
10
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual

11
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-IV
Evaluate the performance of Drop Tail and RED queue management schemes
Queue management schemes can broadly be divided into two groups: schemes that use the
instantaneous queue size, like Drop Tail, and schemes that advocate an element of averaging of the
queue size, like RED, before dropping or marking decisions are made. We focus on Drop Tail and
RED. Drop Tail Drop Tail is perhaps the simplest queue management policy; it drops all incoming
packets after the buffer is full.

Random Early Detection (RED):


The goals of the RED algorithm [3], as per RFC 2309 [2], are to reduce queuing delay and
packet loss, to maintain high link utilization, to better accommodate bursty sources, and to provide a
low-delay environment for interactive services by maintaining a small queue size. In this paper we use
drops, instead of ECN marks, as the feedback signal to the endsystems. After the arrival of each packet,
the RED algorithm calculates the average queue size avg as follows: wq*avg  wq 1 avg *q ,
where wq is the queue weight, q is the instantaneous queue size, and avg is the previous average queue
size. If the avg is less than minth then packets are enqueued. If the avg is more than maxth then all the
incoming packets are dropped. If the avg is in between minth and maxth, then packets are dropped with
a probability pa . The drop functions for Drop Tail and RED are shown in Fig.1

Fig.1. Drop functions of Drop Tail and RED


Many variants of the RED algorithm have been proposed; they either modify the calculation of the
drop function or propose different parameter settings. Fluid Model for TCP Consider a single TCP
flow, whose window size at time t is W(t). When there are no loss indications, W increases by one
packet every RTT; when there is a loss indication, W is cut in half. The rate at which packets are
emitted at time t is roughly W(t)/RTT, so the rate at which acknowledgements or loss indications are
received at time t is W(t − RTT)/RTT. Let p(t) be the packet loss probability for packets emitted at
time t. Suppose there are N flows, and let W N (t) be the sum of all the ), Wwindow sizes. In the
interval (t, t+ N (t) changes in two ways. First, there is a decrement due to window halving: the total
number of flows which receive loss indications is roughly,   t RTT )p RTT W t RTT N    and
(assuming each flow is equally likely to receive a loss indication) the average reduction in window size
for each of these flows is W N (t)/2N. Second, there is an increment of )), since each flow increases its
window size by(N/RTT − O( /RTT, except for those which receive loss indications. The net change
in window size is W t W t N N N N    This suggests that the average window size w(t) = W N (t)/N
should not depend on N, and should obey a differential equation     t RTT pt RTT x w t dt RTT

12
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
dw t     2 1 . An approximation used is that packets are being emitted at rate W(t)/RTT at time t,
which means we are modeling a ratebased mechanism parameterized by W(t) rather than a
windowbased mechanism.

AIMD TCP WITH DROP – TAIL:


The fluid model for the congestion avoidance phase of AIMD TCP is,     t RTT pt RTT
x w t dt RTT dw t     2 1 . (1) Now, let x(t) be the total rate at which packets arrive at the queue,
and let C be the service rate. Let LB(x) be the packet loss probability for a queue with buffer size B,
service rate C and Poisson arrivals of rate x. It was argued in [8], [9] that Poisson arrivals are a good
approximation when buffers are small. Thus p(t) = LB(x(t)). It was also argued in [8], [9] that, for large
number of flows, the blocking probability of an M/M/1 queue is a reasonable model for the packet loss
incurred by a small buffer Drop Tail router. Thus, for the model, the routers will be assumed to have
the following packet loss model: p(t) = (x/C) B (2) where C is the service rate and B is the buffer size.
The packet drop probability is a function of rate x, and the average window size at time t is w(t) =
x(t)RTT. Thus Eq.(1), outlined above, becomes          2 1 2 x t x t RTT p x t RTT dt RTT 
dx t (3)  with equilibrium, RTT p x 1 2 . Local Stability and Local Hopf Bifurcation Analysis
Let x* be the equilibrium point of the system (3), let x(t) = x * +u(t), and linearize about x* , we get
the equation,   t RTT  butau dt du t (4)    where        * * * * * ' * 2 1 , 2 1 x p x . x p
x  x p x b a 0, bWe now recall some results about Eq.(4) [7], where a > 0, b > a, and RTT > 0. A
sufficient condition for stability is 2  bRTT (5) and the system undergoes a Hopf bifurcation at  a /
bRTT b a cos 2 2 1     (6) RTT/cos-1with period 2 (-a/b). Now in terms of network parameters,
we may state the following about Eq.(3). A sufficient condition for local stability, using the drop
function (2), is / 21  1 *   B  w . (7) The two parameters which feature in the condition are the
equilibrium window and the buffer size. The condition will be harder to satisfy as buffers get larger.
Further, the system (3) will undergo a Hopf bifurcation at              B B B cos w 1 1 2 1 1
* (8) with period                    B RTT cos 1 1 2 / 1  . Observe that the Hopf
condition also has the equilibrium window size, and the buffer size, and the period depends on
the round-trip time and the buffer size.

3
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-V
Evaluate the performance of CBQ and FQ Scheduling Mechanisms

CBQ objects: CBQ objects are a subclass of Queue objects that implement class-based queueing.
$cbq insert class
Insert traffic class class into the link-sharing structure associated with link object cbq.

$cbq bind cbqclass id1 [$id2]


Cause packets containing flow id id1 (or those in the range id1 to id2 inclusive) to be
associated with the traffic class cbqclass.

$cbq algorithm alg


Select the CBQ internal algorithm. <alg> may be set to one of: "ancestor-only", "top-level", or
"formal".

CBQ/WRR objects: CBQ/WRR objects are a subclass of CBQ objects that implement
weighted round-robin scheduling among classes of the same priority level. In contrast, CBQ
objects implement packet-by-packet round-robin scheduling among classes of the same priority
level. Configuration Parameters are:

maxpkt_
The maximum size of a packet in bytes. This is used only by CBQ/WRR objects in computing
maximum bandwidth allocations for the weighted round-robin scheduler.

CBQCLASS OBJECTS
CBQClass objects implement the traffic classes associated with CBQ objects.

$cbqclass setparams parent okborrow allot maxidle prio level


Sets several of the configuration parameters for the CBQ traffic class (see below).

$cbqclass parent cbqcl|none


specify the parent of this class in the link-sharing tree. The parent may be specified as ``none'' to
indicate this class is a root.

$cbqclass newallot a
Change the link allocation of this class to the specified amount (in range 0.0 to 1.0). Note that only the
specified class is affected.

$cbqclass install-queue q
Install a Queue object into the compound CBQ or CBQ/WRR link structure. When a CBQ object is
initially created, it includes no internal queue (only a packet classifier and scheduler).

Configuration Parameters are:

okborrow_
is a boolean indicating the class is permitted to borrow bandwidth from its parent.
allot_

14
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
is the maximum fraction of link bandwidth allocated to the class expressed as a real number
between 0.0 and 1.0.
maxidle_
is the maximum amount of time a class may be required to have its packets queued before they
are permitted to be forwarded
priority_
is the class' priority level with respect to other classes. This value may range from 0 to 10, and
more than one class may exist at the same priority. Priority 0 is the highest priority.
level_
is the level of this class in the link-sharing tree. Leaf nodes in the tree are considered to be
at level 1; their parents are at level 2, etc.
extradelay_
increase the delay experienced by a delayed class by the specified time

QUEUE-MONITOR OBJECTS
QueueMonitor Objects are used to monitor a set of packet and byte arrival, departure and drop
counters. It also includes support for aggregate statistics such as average queue size, etc.

$queuemonitor
reset all the cumulative counters described below (arrivals, departures, and drops) to zero. Also, reset
the integrators and delay sampler, if defined.

$queuemonitor set-delay-samples delaySamp_


Set up the Samples object delaySamp_ to record statistics about queue delays. delaySamp_ is a handle
to a Samples object i.e the Samples object should have already been created.

$queuemonitor get-bytes-integrator
Returns an Integrator object that can be used to find the integral of the queue size in bytes..

$queuemonitor get-delay-samples
Returns a Samples object delaySamp_ to record statistics about queue delays.
There are no configuration parameters specific to this object.
State Variables are:

size_
Instantaneous queue size in bytes.
pkts_
Instantaneous queue size in

packets.
parrivals_
Running total of packets that have arrived.
barrivals_
Running total of bytes contained in packets that have arrived.
pdepartures_
Running total of packets that have departed (not dropped).
bdepartures_
Running total of bytes contained in packets that have departed (not dropped).
pdrops_
Total number of packets dropped.
bdrops_
Total number of bytes dropped.
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
FQ Objects:
A queue object is a general class of object capable of holding and possibly marking or discarding
packets as they travel through the simulated topology. Configuration Parameters used for queue objects
are:
limit_
The queue size in packets.
blocked_
Set to false by default, this is true if the queue is blocked (unable to send a packet to its
downstream neighbor).
unblock_on_resume_
Set to true by default, indicates a queue should unblock itself at the time the last packet packet
sent has been transmitted (but not necessarily received).

Other queue objects derived from the base class Queue are drop-tail, FQ, SFQ, DRR, RED and CBQ
queue objects. Each are described as follows:

 Drop-tail objects: Drop-tail objects are a subclass of Queue objects that implement simple
FIFO queue. There are no methods, configuration parameter, or state variables that are specific
to drop-tail objects.
 FQ objects: FQ objects are a subclass of Queue objects that implement Fair queuing. There
are no methods that are specific to FQ objects. Configuration Parameters are:

secsPerByte_

There are no state variables associated with this object.

 SFQ objects: SFQ objects are a subclass of Queue objects that implement Stochastic Fair
queuing. There are no methods that are specific to SFQ objects. Configuration Parameters
are:

maxqueue_
buckets_

There are no state variables associated with this object.


III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
6
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-VI
Evaluate the performance of TCP and UDP Protocols
Comparison Study between TCP and UDP TCP is represented as a connection-oriented protocol, TCP
presents end-to-end communications. Moreover, when the communication is created among the
transmitter and receiver, the data can be send over that communication. While the UDP is a simple
connectionless protocol. UDP does not constitute a dedicated end-to-end communication among the
transmitter and the receiver before the real communication takes place. However, the data is being
transported in one trend from the transmitter to the receiver with no need to verifying the receiver case.
[11, 12]. Figure 1 shows the segment fields of TCP and UDP.

The UDP and TCP are various on the basic operations and applications. The differences in the data
transmission, the TCP presents ordered and reliable delivery of data from the user to the server and vice
versa. UDP considered as a connectionless protocol and does not provide the reliable delivery for the
data. UDP and TCP are various from each other in terms of the basic features for the data transmission
[13]. However, TCP is more reliable comparing to the UDP, where TCP uses the retransmissions and
the message acknowledgment if there is some loss in the packets. Therefore, there is no losing data in
the network. While in the case of UDP does not guarantee that the data has arrived to the receiver or
not. Also, in UDP there is no retransmission, timeout and message acknowledgment. TCP transmits the
messages in an order and these messages are received in the same order at the destination. If the
packets of the data reach in the wrong order, TCP can reorder the data packets. Whilst in UDP, the
sequence of the message is not maintained over the transmission. TCP records the data as a stream of
bytes and sending the message as segments. The messages in UDP are sending as datagrams in the
network. So, both of TCP and UDP have various approaches of sending and receiving the data
[14,15,16]. Figure 2 shows a comparative among TCP and UDP.

17
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Simulation Scenarios:
We have utilized NS2 simulator in this study to evaluate and analyze the behavior of both TCP
and UDP protocols. This simulation has been presented two wired scenarios to carefully verify the
behavior of these protocols. Where in the first scenario the bandwidth is varied from 0.1 Mb/ms to 0.5
Mb/ms and the packet size is fixed at 64 bytes. While in the second scenario the packet size is varied
from 800 bytes to 1000 bytes and the bandwidth is fixed at 0.3 Mb/ms. Simulation parameters shows
in table 1. The nodes number in this study is 8 and the simulation time is 64 second in both scenarios
[19,20]. Figure 3 illustrates the wired simulation environment.

Average Throughput (TP):


It is the bytes successfully received number and it is calculated as follow: TP = No. of Bytes Received
∗ 8 ∗ Simulation Time ∗ 1000 kbpsb
Average End-to-End Delay (e2e delay) :
It is the mean time of the successfully transmitted data packet over the network from the source to the
destination. It is computed as follow: e2e delay = ∑arrive time−send time ∑number of connection
Packet Loss (PL):
It is the difference among the data packets transmitted and the data packets received. It is calculated as
follow: PL = No. of Data Packets Sent − No. of Data Packets Receive

Conclusion:
TCP and UDP are a transportation layer protocols which are considered of the basic protocols of the
internet. The performance of these protocols in various network parameters and scenarios is still not so
clear. The simulation has been used NS2 to assess the behavior of TCP and UDP in varying packet size
and bandwidth. These two protocols were measured in terms of the mean end-to-end delay, mean
throughput, packet delivery percentage, and packet loss ratio. The results have shown that the
performance of TCP is outperformed the UDP in both of the two scenarios. Therefore, this paper
concluded that the TCP is more reliable and better than UDP in terms of all the performance measures.
Future work includes the evaluation of the TCP with other layer protocols in other different scenarios
such as changing the number of nodes or the simulation time. References

18
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-VII
Evaluate the performance of TCP, New Reno and Vegas
TCP New Reno over TCP Reno:
With RED queue the bottleneck link has the bandwidth of 2Mbps, propagation delay is 1ms,
buffer limit is of 50 packets, the minthresh is set to 5, maxthresh is 15, and congestion window size is
2KB. Here 25 flows are used with per TCP source. The congestion window changes over time during
this session are shown in figure 15 and 16:

Comparison of throughput changes over time between these two models has shown in figure 17:

19
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
From the simulation, it is found that TCP NewReno provides 10%-15% higher throughput than the
Reno. The loss rate scenarios are shown below

The simulation result shows that Reno suffers from 20%- 25% more losses than New Reno.

Conclusion:
we described the TCP congestion control mechanism like TCP Reno and TCP Vegas; TCP
NewReno and TCP Reno on based their window size, buffer occupancy, average throughput and loss
of the packet. From the simulation results, it is derived that the TCP Vegas does not provide better
performance with drop-tail because of the difference of buffer occupancy of the router buffer. But in
the case of the RED algorithm, they provide better performance. In the simulation, the performance of
TCP NewReno and TCP Reno are also compared using ns-2 simulator. The performance is evaluated
in case of single and multiple bottleneck links, and two queue management mechanisms- DropTail and
RED. The results from the simulation illustrate the significant performance advantages of NewReno
over Reno. The simulation results indicate that TCP NewReno is more advantageous than TCP Reno,
as the later one suffers from more losses and gives lower throughput between the two.

20
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-VIII
Evaluate the performance of AODV and DSR routing protocols
DSR:
As stated earlier, the DSR protocol requires each packet to carry the full address (every hop in
the route), from source to the destination. Therefore in highly dynamic and large networks the
overhead may consume most of the bandwidth. However, this protocol has a number of advantages
over routing protocols such as AODV, LMR [10] and TORA [11], and in small to moderately size
networks (perhaps up to a few hundred nodes), this protocol may perform better. An advantage of DSR
is that nodes can store multiple routes in their route cache, which means that the source node can check
its route cache for a valid route before initiating route discovery, and if a valid route is found there is
no need for route discovery. This is very beneficial in network with low mobility.

Ad hoc on-demand distance vector (AODV):


AODV maintains one route per destination and destination sequence numbers. Destination
sequence numbers is a process of preventing loops and to determine routes freshness [12]. AODV uses
similar route discovery process of DSR. AODV depends on routing table entries to route data packets
to the destination and to propagate Route International Journal of communication and computer
Technologies, ISSN: 2278-9723 Available at http://www.ijccts.org Volume 01, Issue: Reply back to
the source. In using of individual routing table entries, AODV maintains timer-based states in each
node.
The recent specification of AODV [13] includes an optimization technique to control the RREQ flood
in the route discovery process. It uses an expanding ring search initially to discover routes to an
unknown destination. In the expanding ring search, increasingly larger neighborhoods are searched to
get the destination. The search is controlled by the Time-To-Live (TTL) field in the IP header of the
RREQ packets. If the route to a previously known destination is needed, the prior hop-wise distance is
used to optimize the search.

PERFORMANCE ANALYSIS:
Some important performance metrics can be evaluated:- Packet delivery Ratio: The percentage
of the data packets sent to the objectives to individuals yielded through the CBR sources. Packets
delivered and packets lost are intriguing in to contemplation. Throughput: There are two
representations of throughput; solitary is the sum of data broadcasted over the epoch of instant uttered
in kilobits per second (Kbps). End-to-end Delay: The packet end-to-end delay is the moment of
production of a packet through the source up to the destination reaction. This time is articulated in
second.
Simulation parameters for implementation of AODV and DSR
Parameter Value
Number of Nodes 3,10
Radio-propagation Model Propagation/ TwoRayGround
Network interface Type Phy/WirelessPhy
MAC Type Mac/802_11
Channel Type Channel/Wireless Channel
Interface Queue Type Queue/DropTail/ PriQueue
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Link Layer Type LL
Maximum Packet 300
Routing Protocols AODV/DSR
Simulator Ns-2.35
Antenna Type Antenna/OmniAntenna

DSR is an On-Demand source routing protocol, and this is the major rationale for it owing an
elevated End-to-End Delay, wherever route is looked only at what time needed and there is a route
Discovery means occurring all time and it also has to clutch a bulky transparency apiece of time, in
consequence the elevated delay. AODV conversely has only one route per destination in the routing
table, which is persistently updated rooted in sequence number.

AODV depicts elevated throughput than the DSR. The AODV has a large amount of routing
packets than DSR since the AODV avoids loop and freshness of routes whereas DSR owns
obsolete routes. Its throughput is elevated than further routing protocols at towering mobility.

22
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-IX
Evaluate the performance of AODV and DSDV routing protocols
Wireless networking is an emerging technology that allows user to access information and
services electronically, regardless of their geographic position. Wireless network can be classified in
two types- Infrastructure networks and Infrastructure Less networks or Ad-hoc Networks Infrastructure
Networks:-Infrastructure network consist of fixed and wired gateways. A mobile host communicates
with a bridge in the network (called base station) within its.
Ad-hoc network routing protocols may be classified in many ways depending on their routing
algorithm, network structure communication model, and state of information etc, but most of the
protocols depending on their routing algorithm, and network structure [3][10]. Based on the network
structure ad-hoc network classify as Flat routing, hierarchical routing, geographical position assisted
routing. Flat routing covers two types of routing protocols based on routing algorithm. Based on the
Routing algorithms, routing protocols are classified as Proactive routing protocols and Reactive
Routing protocols. • Proactive Routing: DSDV (Destination Sequence Distance Vector Routing) •
Reactive Routing: AODV (Ad-hoc on-demand distance vector routing protocol), DSR (Dynamic
source routing)

Network Setup and Simulation Parameters


The following network setup and simulation parameters are used in this paper to analyze the
performance of proactive and reactive routing protocols

This topology is consists by 12 nodes, where 6 nodes are senders and remaining are receivers.
All the senders start traffic at different time. So the transmitting node share the channel bandwidth with
other previous transmitting nodes. This topology is generated by the network animator, by considering
the following simulation parameters table.

23
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual

The simulation results are shown in the following section in the form of graphs and charts. In
this paper an attempt has been made to evaluate the performance of two well known routing protocol
DSDV, AODV according to his simulation results. The simulation results are genrated through the
Excel graphs according to above mentioned criteria shown in table.

24
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-X
Evaluate the performance of IEEE 802.11 and IEEE 802.15.4
OVERVIEW OF THE IEEE:
802.11 IEEE 802.11 is a set of standards for implementing wireless local area network
(WLAN) computer communication in the 2.4, 3.6, 5 and 60 GHz frequency bands. They are created
and maintained by the IEEE LAN/MAN Standards Committee (IEEE 802). These standards provide
the basis for wireless network products using the Wi-Fi brand[3]. It has been deployed in airports,
coffee shops, colleges, homes etc. Access points(APs) are used to which a mobile user could connect
to. Users scan the wireless channel in order to find the AP which shows the highest signal strength and
associate to it.

OVERVIEW OF THE IEEE 802.15.4:


IEEE 802.15.4 is a standard which specifies the physical layer and media access control for
Low-Rate Wireless Personal Area Networks (LR-WPANs)[4][5]. It is maintained by the IEEE 802.15
working group. IEEE standard 802.15.4 intends to offer the fundamental lower network layers of a
type of wireless personal area network (WPAN) which focuses on low data rate, low power
consumption and low-cost wireless networking[6]. The basic framework conceives a 10-meter
communications range with a transfer rate of 250 kbit/s. A] Protocol architecture: The IEEE 802.15.4
protocol architecture consists of layers [7].

Implementation steps:
Following are the steps for implementation.
1: Write the tcl program for network.
2: Create the CBR and Scenario file for the network.
3: Start Cygwin
4: Go to ns-2.29 directory.
5: Export the following
path:
i. PATH=$PATH:/usr/local/ns-allinone2.29/bin:/usr/local/ns-
allinone2.29/tcl8.4.11/unix:/usr/local/ns-allinone2.29/tk8.4.11/unix:/usr/local/iNSpect-
release3.5/src
ii. ii.
LD_LIBRARY_PATH=/usr/local/ns-allinone2.29/otcl-1.11:/usr/local/ns-
allinone2.29/lib:/usr/local/iNSpect-release3.5/gtkglext/lib
iii. iii. TCL_LIBRARY=/usr/local/ns-allinone2.29/tcl8.4.11/library
iv. iv. export PATH
v. v. export LD_LIBRARY_PATH
vi. vi. export TCL_LIBRARY
6: Compile the tcl code for network. Files ‘.tr’ and ‘.nam’ will be generated.
7: Start the NS2 command prompt.
8: Start Network Animator.
9: Load ‘.tr’ file in trace-graph
10: Evaluate the performance of the network by considering various parameters obtained in the graph.
The network simulator window is shown below in Figure 2. The network animator tool is used to
visualize the simulation of the networks in the form of actual communication patterns.
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual

Motivation for simulation:


1: Network simulator does not require costly equipments, therefore cheaper.
2: The complex scenario can be easily tested.
3: More ideas can be tested in a smaller timeframe
4: Controlled experimental conditions – Repeatability helps aid debugging
5: Disadvantages: Real systems too complex to model[12]

SIMULATION RESULTS:
Simulation is carried out for evaluating and comparing the performance of 802.11 and
802.15.4/ZigBee network with respect to jitter, End-to-End delay and packet dropped parameters. For
simulation purpose we used tracegraph 2.02 software. In order to get simulation results for various
parameters we have to select the following path: 1: Tracegraph-bin-win32-trgraph2.02-file-open a trace
file (e.g. 10.tr/20.tr/30.tr for 10,20,30 nodes respectively.) 2: Then we will get network information and
graph window. In network information window after selecting network information option we will get
simulation information as shown below. In graph window we have to choose option 2D Graphs, from
where we can select various options like end-to-end delay, packets dropped, jitter etc. to get the
resulting graphs. As an illustration, Network Simulation Information of 802.11 and 802.15.4/ZigBee
network with 10 nodes.

26
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-XI
Evaluate the performance of IEEE 802.11 and SMAC
S-MAC is based on the Mote platform that runs TinyOs operating system. For hardware
implementation, which needs real hardware as its running platform, at times it is not easy to carry out
the performance analysis for the experimentation purposes and hence S-MAC has been also
implemented in NS2[11][12][13], the network simulator. SMAC has been tested on the real platform
but little work has been done on the NS2 for further improving the SMAC for the mission critical
applications in wireless sensor networks. Besides this, [9][10][14]researchers have studied SMAC
performance for energy and latency. But for mission critical applications one needs to analyze the
performance of S-MAC protocol in terms of residual energy of nodes, throughput , packet delivery
fraction and the impact of different duty cycles to analyze the protocol fully.
The default Energy Model for SMAC

IdlePower | 1.0watts
TxPower | 1.0watts
RxPower | 1.0watts
SleepPower | 0.001watts
ransitionPower | 0.2 watts
ansitionTime 0.005seconds
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
In Fig.6 and Fig.7, varying the duty cycle from 1% to 30%
the residual energy of sink node is observed for
MIAT=25seconds which is considered to be the lower
traffic rate. Varying the duty cycle from 1% to 30% the
residual energy of sink node is observed for
MIAT=50seconds which is considered to be the lower traffic
rate.

We have analyzed the S-MAC protocol in terms of throughput and residual energy. It is observed that
it’s not necessary that increasing the duty cycle percentage will always decrease the residual energy.
At higher traffic rates, we can achieve energy effeciency (residual energy) and throughput with the
proper choice of duty cycle. So [13]for mission critical application where apart from energy
effeciency, the data transport performance is also important, the S-MAC protocol can be used with the
proper choice of duty cycle to achieve better throughput and energy efficiency.
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-XII
Capturing and Analysis of TCP and IP Packets

To analyze TCP/IP packets, we are going to setup a small test environment. For this, we will
use two machines, one as a (web-) server, the other one as client. You could also use only one
system, however, then the source and destination IP address would be the same, making the
analysis less intuitive.

The webserver is serving a simple HTML website, which will be requests by a browser from
the client. We will listen into this communication with the help of Wireshark, a widely-used
network protocol analyzer. It doesn’t matter on which of those two systems you use Wireshark,
as the communication between them is the same. For our convenience, we will hide non
relevant packets with a display filter in Wireshark:
ip.addr == 10.10.10.1 && tcp.port == 80

After accessing the webserver with our client’s browser, we observe all packets going from or
to our server on port 80 with the help of Wireshark:
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual

These are all the packets going back and forth between our client (10.10.10.2) requesting a
webpage from our webserver (10.10.10.1). In the first three packets, we can see the previously
described TCP three-way handshake for the connection establishment.

In packet number 4, we can see a GET request from the client to the server, being acknowledged by the
server in packet 5.

Packet 6 transmits the webpage data to the client, who acknowledges the receipt in packet 7.

Starting with packet 8, we can see a typical connection termination. After the webpage is transmitted
from the server to the client, the server sends a [FIN, ACK] to signalize the termination of the
connection from its side. The client sends a [FIN, ACK] to acknowledge the [FIN] of the server and
send a [FIN] on its own. In packet 10 the server acknowledges the [FIN] of the client. The connection
is now terminated.
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-XIII
Simulation and Analysis of ICMP and IGMP Packets
ICMP:
ICMP or Internet Control Message Protocol is one of the major protocols of the TCP/IP. ICMP is a
mechanism used by the host, routers, and gateways to send error messages back to the sender. As the
IP does not provide any mechanism for error reporting and control, ICMP has been designed to
compensate for these deficiencies of the IP. However, it only reports the error and doesn't correct
the error.

The ICMP messages are divided into two categories:

1. Error Message
2. Query Message

Error Message
The error messages report the problems which may be faced by the hosts or routers when they
process the IP packet.

1. Destination Unreachable: When any router or gateway determines that the packet cannot be
sent(due to link failure, congestion, etc) to the final destination then it sends an ICMP
destination unreachable message to the source. Not only the routers but the destination host
can also send the ICMP error message if there is any failure at the destination like hardware
failure, port failure, etc.
2. Source Quench: A source quench is a request by the receiver to the sending host or sender
to reduce the rate at which the sender is sending the data. This message is sent by the
receiver when it has congestion and there are chances that the packet may get lost if the
sender keeps on sending the packets at the same rate.
3. Parameter Problem: When the packet is received by the router then the calculated checksum
should be equal to the received checksum. If there is any ambiguity then the packet is dropped
by the router and the parameter problem message is sent.
4. Time Exceeded: Whenever the TTL(Time to Live) field of the datagram reduces to zero
then the router discards the datagram and sends the time exceeded message to the source.
5. Route Redirect: If any router determines that the host has incorrectly sent the packet to the
different router the router uses the route redirect message to inform the host to update its
routing information. So, it helps in improving the efficiency of the routing process.
Query Message:
The ICMP protocol can diagnose some network problems also. Query messages help the hosts to get
some specific information from a router or another host.

1. TimeStamp Request/Reply: Host and routers determine the round trip- time required for an
IP datagram to travel between hosts or routers. It can also be used to synchronize the clocks in
two systems.
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
2. Router Solicitation and Advertisement: If the host wants to send the data to a host on
another network then it needs to know the address of the routers connected. The host also
needs to know if routers are alive and operational. All these functions are provided by the
router solicitation and advertisement message.
3. Address Mask Request/Reply: The host broadcast the address mask request if it does not
know the address of the router. The router receiving the address mask request replies with
the necessary mask for the host.
4. Echo Request/ Echo Reply: It a command designed checking the connectivity between two
hosts. Example: ping command.

IGMP:
IGMP is also a protocol of the TCP/IP. Internet Group Message Protocol is an Internet protocol
that manages multicast group membership on IP networks. Multicast routers are used to send the
packets to all the hosts that are having the membership of a particular group. These routers receive
many packets that are to be transmitted to various groups and they just can't broadcast it as it will
increase the load on the network.

So to overcome this problem a list of groups and their members is maintained and IGMP helps the
multicast router in doing so. The multicast router has a list of the multicast address for which there
are any members in the network. There is a multicast router for each group that distributes the
multicast traffic of the group to the members of that group.

Major goals of the IGMP protocol.

1. To inform the local multicast router that the host wants to receive the multicast traffic of a
particular group.
2. To inform the local multicast router that the host wants to leave a particular group.

Versions of IGMP

 IGMPv1
 IGMPv2
 IGMPv3

32
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-XIV

SCTP:
Analyze the Protocols SCTP, ARP, NetBIOS, IPX VINES
Stream Control Transmission Protocol (SCTP) is a transport-layer protocol that can be used on top of
IP networks for end-to-end communications. SCTP is an IETF standard developed by the Transport
Area Working Group (tsvwg). SCTP has been standardized by the IETF in a series of RFCs that define
the protocol, its applicability to other protocols, and its management. SCTP was originally defined in
RFC 2960 in October 2000, but was then updated with RFC 4960 in September 2007.

SCTP is similar to TCP in many ways. They are both unicast connection-oriented protocols that
provide reliable transport, in-sequence packet delivery and rate-adaptive congestion control. TCP has
an additive 16-bit checksum (RFC 1071) and SCTP has a 32-bit CRC (RFC 4960).

ARP:

Most of the computer programs/applications use logical address (IP address) to send/receive
messages, however the actual communication happens over the physical address (MAC address) i.e
from layer 2 of OSI model. So our mission is to get the destination MAC address which helps in
communicating with other devices. This is where ARP comes into the picture, its functionality is to
translate IP address to physical address.

The acronym ARP stands for Address Resolution Protocol which is one of the most important
protocols of the Network layer in the OSI model.
Note: ARP finds the hardware address, also known as Media Access Control (MAC) address, of a
host from its known IP address.

NetBIOS:

NetBIOS (/ˈnɛtbaɪɒs/) is an acronym for Network Basic Input/Output System. It provides services
related to the session layer of the OSI model allowing applications on separate computers to
communicate over a local area network. As strictly an API, NetBIOS is not a networking protocol.
Older operating systems[clarification needed] ran NetBIOS over IEEE 802.2 and IPX/SPX using the NetBIOS
Frames (NBF) and NetBIOS over IPX/SPX (NBX) protocols, respectively. In modern networks,
NetBIOS normally runs over TCP/IP via the NetBIOS over TCP/IP (NBT) protocol. This results in
each computer in the network having both an IP address and a NetBIOS name corresponding to a
(possibly different) host name.

IPX VINES:
VINES uses protocols on the data link layer to control the movement of data between nodes on the
network that share physical media. The data link layer provides mechanisms for error control,
flow control, and link management.

The VINES data link layer provides two

functions: Packet transfer


Diagnostics packet echo between neighbors
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
The data link layer protocol entity is a finite-state machine. It functions within the VINES
kernel in some cases. In other cases, a device driver and the communications card in the server
or workstation work together to perform the protocol functions.

On the data link layer, the VINES Fragmentation Protocol (FRP) breaks up and reassembles
packets as follows:

On the sending end, FRP converts packets into smaller units, or fragments, when necessary
for transmission by the physical medium or data link protocol. Each fragment is contained
within a frame that holds the fragment as well as the various protocol headers.
On the receiving end, FRP reassembles the fragments into internet packets.
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
Experiment-XV
Analysis of HTTP, DNS and DHCP Protocols
HTTP (Hypertext Transfer Protocol)
It is the TCP/IP based application layer protocol and is deployed to transport data in the form of image,
video, text, HTML files and query results on the World Wide Web.

The default port assigned to it is 80, however, the other ports are also applicable. It is basically the
standardization of communication between various machines on the Internet to communicate with each
other.

Features
 Connectionless: Unlike FTP, in which the connection is established and continued till the
end of the entire communication session, the HTTP is connectionless.
 The HTTP client is the one in which the browser starts up an HTTP request and after the request
is raised it disconnects itself from the server and holds up for a response. When the server is
ready with the response, it again makes a new connection with the client and delivers the
response.
 Media free: Data in any form like voice, text or video can be sent over it, as it is the duty of
the client and the server to handle the analyzing part at their respective ends.
 Stateless
HTTP Model
It is based on the client-server architecture model whereas the search engines like Mozilla, web
browsers etc., behave as HTTP clients and the web server behave as HTTP servers.

The Client initiates the request to the server by using different methods like URI, pursued by the MIME
messages which have the information regarding format, client data, and content on a UDP connection.

The HTTP server in response sends back a status message with a success or error code, along with the
information requested by the client and again is pursued by MIME messages.

For understanding and writing the HTTP messages, we should understand some of the parameters that
are used in building up the messages. The parameters are explained below for your reference .

DNS:

The Domain Name System (DNS) is the phonebook of the Internet. Humans access information online
through domain names, like nytimes.com or espn.com. Web browsers interact through Internet Protocol
(IP) addresses. DNS translates domain names to IP addresses so browsers can load Internet resources.

Each device connected to the Internet has a unique IP address which other machines use to find the
device. DNS servers eliminate the need for humans to memorize IP addresses such as 192.168.1.1 (in
IPv4), or more complex newer alphanumeric IP addresses such as 2400:cb00:2048:1::c629:d7a2 (in
IPv6).
III B.TECH ECE DCN Lab Department of Computer Science & Engineering
Manual
DHCP (Dynamic Host Configuration Protocol):
It is an application layer protocol of the TCP/IP protocol suite.

It is used for managing various networking systems by allocating the IP addresses, subnet mask,
default gateway, and other relating routing information to the host devices dynamically, so that the
process becomes self-operating and the IP addresses will be allocated to various network devices
automatically without any manual interference.

It is deployed in LAN as well as in WAN networks. DHCP follows the client-server architecture model
of communication. It is a connection-less protocol based on UDP. The port 67 is used by the server as
the destination port and port 68 is used by the client host.

The DHCP server allows the network devices to request for IP address and other relevant data
automatically from the ISP and thus lower down the need for manual configuration done by the
network administrator.

You might also like