Netsim Experiment Manual v9 1
Netsim Experiment Manual v9 1
Netsim Experiment Manual v9 1
The information contained in this document represents the current view of TETCOS on the
issues discussed as of the date of publication. Because TETCOS must respond to changing
market conditions, it should not be interpreted to be a commitment on the part of TETCOS,
and TETCOS cannot guarantee the accuracy of any information presented after the date of
publication.
This manual is for informational purposes only. TETCOS MAKES NO WARRANTIES,
EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS
DOCUMENT.
Warning! DO NOT COPY
Copyright in the whole and every part of this manual belongs to TETCOS and may not be
used, sold, transferred, copied or reproduced in whole or in part in any manner or in any
media to any person, without the prior written consent of TETCOS. If you use this manual
you do so at your own risk and on the understanding that TETCOS shall not be liable for any
loss or damage of any kind.
TETCOS may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from TETCOS, the furnishing of this document does not give you
any license to these patents, trademarks, copyrights, or other intellectual property. Unless
otherwise noted, the example companies, organizations, products, domain names, e-mail
addresses, logos, people, places, and events depicted herein are fictitious, and no association
with any real company, organization, product, domain name, email address, logo, person,
place, or event is intended or should be inferred.
Rev 9.1 (V), August 2016, TETCOS. All rights reserved.
All trademarks are property of their respective owner.
Contact us at
TETCOS
214, 39th A Cross, 7th Main, 5th Block Jayanagar,
Bangalore - 560 041, Karnataka, INDIA. Phone: +91 80 26630624
E-Mail: [email protected]
Visit: www.tetcos.com
Contents
1.
2.
3.
Study the working of spanning tree algorithm by varying the priority
among the switches. .................................................................................... 18
4.
Understand the working of Connection Establishment in TCP using
NetSim. ........................................................................................................ 21
5.
Study the throughputs of Slow start + Congestion avoidance (Old
Tahoe) and Fast Retransmit (Tahoe) Congestion Control Algorithms. .......... 25
6.
Study how the Data Rate of a Wireless LAN (IEEE 802.11b) network
varies as the distance between the Access Point and the wireless nodes is
varied .......................................................................................................... 35
7.
Study the working and routing table formation of Interior routing
protocols, i.e. Routing Information Protocol (RIP) and Open Shortest Path
First (OSPF) .................................................................................................. 40
8.
9.
Plot the characteristic curve throughput versus offered traffic for a
Slotted ALOHA system ................................................................................. 55
10. Understand the impact of bit error rate on packet error and investigate
the impact of error of a simple hub based CSMA / CD network.................... 60
11. To determine the optimum persistence of a p-persistent CSMA / CD
network for a heavily loaded bus capacity. .................................................. 65
Study the working of BGP and formation of BGP Routing table ........... 84
15. Study how call blocking probability varies as the load on a GSM
network is continuously increased ............................................................... 90
16. Study how the number of channels increases and the Call blocking
probability decreases as the Voice activity factor of a CDMA network is
decreased .................................................................................................... 94
17. Study the SuperFrame Structure and analyze the effect of SuperFrame
order on throughput .................................................................................... 98
18. Analyze the scenario shown, where Node 1 transmits data to Node 2,
with no path loss and obtain the theoretical throughput based on IEEE
802.15.4 standard. Compare this with the simulation result. ..................... 103
19. To analyze how the operational behavior of Incumbent (Primary User)
affects the throughput of the CR CPE (Secondary User).............................. 109
20. To analyze how the allocation of frequency spectrum to the Incumbent
(Primary) and CR CPE (Secondary User) affect the throughput of the CR CPE
(Secondary User). ...................................................................................... 116
21. Study how the throughput of LTE network varies as the distance
between the ENB and UE (User Equipment) is increased............................ 122
22. Study how the throughput of LTE network varies as the Channel
bandwidth changes in the ENB (Evolved node B) ....................................... 128
23.
24.
1. Introduction to NetSim
1.1 Introduction to network simulation through the NetSim
simulation package
1.1.1 Theory:
What is NetSim?
NetSim is a network simulation tool that allows you to create network scenarios, model
traffic, and study performance metrics.
What is a network?
A network is a set of hardware devices connected together, either physically or logically. This
allows them to exchange information.
A network is a system that provides its users with unique capabilities, above and beyond what
the individual machines and their software applications can provide.
What is simulation?
A simulation is the imitation of the operation of a real-world process or system over time.
Network simulation is a technique where a program models the behavior of a network either
by calculating the interaction between the different network entities (hosts/routers, data
links, packets, etc) using mathematical formulae, or actually capturing and playing back
observations from a production network. The behavior of the network and the various
applications and services it supports can then be observed in a test lab; various attributes of
the environment can also be modified in a controlled manner to assess how the network
would behave under different conditions.
Network model: A Network model is a flexible way of representing devices and their
relationships. Networking devices like hubs, switches, routers, nodes, connecting wires
etc. are used to create a network model.
Click here to drop the application icon to generate traffic. Then
right click on application icon to edit properties
Click here
to Run
Simulation
Click here to
enable the
traces
Click to view
Packet
Animation
Click to view the
simulated network
Click on
Browse to
select the
experiments
Click to
select the
metrics
Plot the chart
here
10
2.1 Theory:
Nodes in network need MAC Addresses in addition to IP address for communicating with
other nodes. In this experiment we will see how IP-forwarding is done when a node wants to
send data within a subnet and also when the destination node is outside the subnet.
2.2 Procedure
Step 1:
Go to Simulation New Internetworks
Step 2:
Click & drop Wired Nodes, Switches and
Router onto the Simulation Environment as
shown and link them.
11
Click Packet Trace icon in the tool bar. This is used to log the packet details.
Check All the Attributes button for Common Attributes, TCP and WLAN.
And Click on Ok button. Once the simulation is completed, the file gets stored in the
location specified.
12
Step 4:
Simulation Time- 10 Seconds
Note: The Simulation Time can be selected only after doing the following two tasks,
After clicking on Run Simulation, edit IP and ARP Configuration tab by setting Static ARP
as Disable. If Static ARP is enabled then NetSim automatically creates the ARP table for
each node. To see the working of the ARP protocol users should disable Static ARP. When
disabled ARP request would be sent to the destination to find out the destinations MAC
Address
Click on OK button to simulate.
2.3 Output - I
Open Packet Trace for performing Packet Trace analysis
13
2.4 Inference - I
Intra-LAN-IP-forwarding:
ARP REQUEST
Source
Destination
Switch
ARP Response
ARP Response
A Brief Explanation:
NODE-1 broadcasts ARP_Request which is then broadcasted by SWITCH-4. NODE -2 sends
the ARP_Reply to NODE-1 via SWITCH-4. After this step, data is transmitted from NODE1 to NODE-2. Notice the DESTINATION_ID column for ARP_Request type packets.
Step 5: Follow all the steps till Step 2 and perform the following sample:
Sample 2:
To run the simulation, drop the Application icon and set the Source_Id and Destination_Id as
1 and 3 respectively.
14
Click Packet Trace icon in the tool bar. This is used to log the packet details.
Give a file name and check All the Attributes button for Common Attributes, TCP and
WLAN.
And Click on Ok button. Once the simulation is completed, the file gets stored in the
specified location.
Step 6:
After clicking on Run Simulation, edit IP and ARP Configuration tab by setting Static ARP
as Disable. Click on OK button to simulate.
15
2.5 Output - II
Across-Router-IP-forwarding:
STEP-1
STEP-2
ARP request for
Default Gateways
MAC address
Source
Default Gateway
Data Packet
Default Gateway
Source
ARP request for
Destinations MAC
address
ARP
Response
Destination
16
Data
Packet
17
3.2 Procedure:
Please navigate through the below given path to,
Create Scenario: Simulation New Internetworks
Create the scenario as shown,
18
Sample Inputs:
Inputs for the Sample experiments are given below,
Sample 1:
Application properties:
Traffic Type
Custom
Source_Id
Destination_Id
5
Distribution
Constant
1460
Distribution
Constant
20000
Packet Size
Wired Node D is sending data to Wired Node E. The node properties are default.
(Note: Wired Node F is not generating Traffic to any other Wired Nodes)
Switch Properties
Switch A
2
Switch Priority
Switch B
Switch C
(Note: Switch Priority has to be changed for all the interfaces of Switch.)
Sample 2:
Set all properties as above and change properties of Switch as follows:
Switch Properties
Switch Priority
Switch A
1
Switch B
2
Switch C
3
(Note: The Simulation Time can be selected only after doing the following two tasks,
3.3 Output:
Metrics
screen
under
Resources.
Sample 1:
Sample 2:
3.4 Inference:
In the Sample 1, Switch B was assigned least priority and was selected as a Root switch. The
Green line indicates the forward path and the Black line indicates the blocked path. The
frame from Wired Node D should take the path through the Switch B to reach the Wired
Node E.
In the Sample 2, Switch A was assigned least priority and selected as a Root switch. In this
case, the frame from Wired Node D can directly reach the destination Wired Node E.
20
4.1 Theory
When two processes wish to communicate, their TCPs must first establish a connection i.e.
initialize the status information on each side. Since connections must be established between
unreliable hosts and over the unreliable internet communication system, a three-way
handshake with clock based sequence numbers is the procedure used to establish a
Connection. This procedure normally is initiated by one TCP and responded by another TCP.
The procedure also works if two TCPs simultaneously initiate the procedure. When
simultaneous attempt occurs, each TCP receives a SYN segment which carries no
acknowledgement after it has sent a SYN.
The simplest three-way handshake is shown in the following figure.
TCP A
TCP B
1. CLOSED
LISTEN
<A: SEQ=100><CTL=SYN>
SYN-RECEIVED
3. ESTABLISHED `
SYN-RECEIVED
4. ESTABLISHED
<A: SEQ=101><ACK=301><CTL=ACK>
ESTABLISHED
<A: SEQ=101><ACK=301><CTL=ACK><DATA>
ESTABLISHED
2. SYN-SENT
5. ESTABLISHED
Explanation:
The above figure should be interpreted in the following way. Each line is numbered for
reference purposes. Right arrows () indicates the departure of a TCP Segment from TCP A
to TCP B, or arrival of a segment at B from A. Left arrows ( ) indicates the reverse. TCP
states represent the state AFTER the departure or arrival of the segment (whose contents are
shown in the center of each line).Segment contents are shown in abbreviated form, with
sequence number, control flags, and ACK field. In line2 of the above figure, TCP A begins
21
by sending a SYN segment indicating that it will use sequence numbers starting with
sequence number 100. In line 3, TCP B sends a SYN and acknowledges the SYN it received
from TCP A. Note that the acknowledgment field indicates TCP B is now expecting to hear
sequence 101, acknowledging the SYN which occupied sequence 100. At line 4, TCP A
responds with an empty segment containing an ACK for TCP B's SYN; and in line 5, TCP A
sends some data.
4.2 Procedure
Step1:
Go to Simulation New Internetworks
Step2:
Click & drop Wired Nodes and Router onto the Simulation Environment and link them as
shown below.
Step3:
To run the simulation, drop the Application icon and change the Application_type to FTP.
The Source_Id is 1 and Destination_Id is 2.
22
Click Packet Trace icon in the tool bar. This is used to log the packet details.
Select the required attributes and click OK. Once the simulation is completed, the file gets
stored in the location specified.
Note: Make sure that after enabling the packet trace you select the TCP option in the
Internetworks and then select the required attributes.
Simulation Time - 10 sec
After clicking on Run Simulation, edit IP and ARP Configuration tab by setting Static
ARP as Disable.
4.3 Output
The following results will be obtained:
23
4.4 Inference
In MS Excel go to DATA and select FILTER option to view only the desired rows and
columns as shown in the figure
Line 1, 2, 3 and 4 of the above table are ARP related packets and not of interest to us in this
experiment.
In line 9 of the above figure we can see that NODE-1 is sending a control packet of type
TCP_SYN requesting the connection with the NODE-2, and this control packet is first sent to
the ROUTER-3 (receiver ID). In line 10, the ROUTER-3 is sending the TCP_SYN packet
that has been received from NODE-1 to the NODE-2. In line 11, NODE-2 is sending the
control packet of type TCP_SYN_ACK to NODE-1, and this control packet is first sent to the
ROUTER-3. This TCP_SYN_ACK is the ACK packet for the TCP_SYN packet. In line 12,
ROUTER-3 is sending the TCP_SYN_ACK, (received from NODE-2) to the NODE-1. In
line 13, NODE-1 is sending the TCP_ACK to NODE-2 via ROUTER-3 making the
CONNECTION_STATE as TCP_ESTABLISHED.
Once the connection is established, we see that a packet type of type FTP is sent from the
NODE-1 to the NODE-2 in line 14.
24
One of the important functions of a TCP Protocol is congestion control in the network. Given
below is a description of how Old Tahoe and Tahoe variants (of TCP) control congestion.
Old Tahoe:
Congestion can occur when data arrives on a big pipe (i.e. a fast LAN) and gets sent out
through a smaller pipe (i.e. a slower WAN). Congestion can also occur when multiple input
streams arrive at a router whose output capacity is less than the sum of the inputs. Congestion
avoidance is a way to deal with lost packets.
The assumption of the algorithm is that the packet loss caused by damaged is very small
(much less than 1%), therefore the loss of a packet signals congestion somewhere in the
network between the source and destination. There are two indications of packets loss: a
timeout occurring and the receipt of duplicate ACKs
Congestion avoidance and slow start are independent algorithms with different objectives.
But when congestion occurs TCP must slow down its transmission rate and then invoke slow
start to get things going again. In practice they are implemented together.
Congestion avoidance and slow start requires two variables to be maintained for each
connection: a Congestion Window (i.e. cwnd) and a Slow Start Threshold Size (i.e. ssthresh).
Old Tahoe algorithm is the combination of slow start and congestion avoidance. The
combined algorithm operates as follows,
1. Initialization for a given connection sets cwnd to one segment and ssthresh to 65535
bytes.
25
26
5.2 Procedure:
Go to Simulation New Internetworks
Sample Inputs:
Follow the steps given in the different samples to arrive at the objective.
Sample 1.a: Old Tahoe (1 client and 1 server)
In this Sample,
Application Properties
Custom
Application Type
Source_Id
4(Wired Node D)
Destination_Id
3(Wired Node C)
27
Packet Size
Distribution
Constant
Value (bytes)
1460
Inter Arrival Time
Distribution
Constant
1300
1460
Old Tahoe
Window size(MSS)
Link 1
Link 2
Link 3
10
10
Uplink BER
0.000001
0.000001
0.000001
Downlink BER
0.000001
0.000001
0.000001
28
Wired Node A and Wired Node B are connected with Router C by Link 1 and Link 2.
Wired Node E and Wired Node F are connected with Router D by Link 4 and Link 5.
Wired Node A and Wired Node B are not transmitting data in this sample.
Application 1
Application 2
Custom
Application Type
Source_Id
Destination_Id
Packet Size
Distribution
Constant
Constant
Value (bytes)
1460
1460
Constant
Constant
1300
1300
29
1460
Old Tahoe
Window size(MSS)
Link 1
Link 2
Link 3
Link 4
Link 5
10
10
30
Uplink BER
0.000001
0.000001
Downlink BER
0.000001
0.000001
Wired Node A, Wired Node B & Wired Node C is connected with Router D by Link 1,
Link 2 & Link 3.
Wired Node F, Wired Node G & Wired Node H is connected with Router E by Link 5,
Link 6 & Link 7.
Wired Node A, Wired Node B and Wired Node C are not transmitting data in this sample.
Application 1
Application 2
Application 3
Custom
Application Type
Source_Id
Destination_Id
Packet Size
Distribution
Constant
Constant
Constant
Value (bytes)
1460
1460
1460
Constant
Constant
Constant
1300
1300
1300
1460
1460
1460
Congestion Control
Algorithm
Old Tahoe
Old Tahoe
Old Tahoe
Window size(MSS)
32
Link
Properties
Link 1
Max Uplink
Speed
(Mbps)
Max
Downlink
Speed(Mbps)
Link 2
Link 3
Link 4
Link 5
Link 6
Link 7
10
10
Uplink BER
0.000001
0.000001
0.000001
0.000001
0.000001
0.000001
0.000001
Downlink
BER
0.000001
0.000001
0.000001
0.000001
0.000001
0.000001
0.000001
5.3 Output
Comparison Table:
TCP
Downloads
Metrics
Throughput(Mbps)
1 client and 1
Segments Retransmitted +
server
2 clients and 2
servers
Segments Retransmitted +
Seg Fast Retransmitted
Throughput(Mbps)
Slow start +
Fast
Congestion avoidance
Retransmit
5.926432
6.120320
195
200
8.796208
8.810224
343
378
9.144272
9.23304
401
434
Note: To calculate the Throughput (Mbps) for more than one application, add the
individual application throughput which is available in Application Metrics (or Metrics.txt) of
Performance Metrics screen. In the same way calculate the metrics for Segments
Retransmitted + Seg Fast Retransmitted from TCP Metrics Connection Metrics.
5.4 Inference:
User lever throughput: User lever throughput of Fast Retransmit is higher when compared
then the Old Tahoe (SS + CA). This is because, if a segment is lost due to error, Old Tahoe
waits until the RTO Timer expires to retransmit the lost segment, whereas Tahoe (FR)
retransmits the lost segment immediately after getting three continuous duplicate ACKs.
This results in the increased segment transmissions, and therefore throughput is higher in the
case of Tahoe.
34
6.2 Procedure:
Please navigate through the below given path to,
Go to Simulation New Internetworks
Sample Inputs:
Follow the steps given in the different samples to arrive at the objective.
In Sample 1,
The AP, Wireless Nodes, Router, Switch and Wired Nodes are interconnected as shown:
355
Y/Lon
150
Interface_Wireless properties
RTS Threshold(bytes)
2347
Retry Limit(DataLink_Layer)
Rate _Adaptation
GENERIC
2.5
Fading Figure
1.0
100
Downlink BER
36
TCP
350
Y/Lon
150
Interface_Wireless properties
Buffer Size(MB)
RTS Threshold(bytes)
2347
Retry Limit
Click and drop the Application, set properties and run the simulation.
Application Properties
Application Type
Custom
Source_Id
Destination_Id
5
Packet Size
Distribution
Constant
Value (bytes)
1460
Constant
900
37
Upon completion of the experiment, Save the metrics result for comparison by using
Export to Excel . Save the excel file in any user defined location.
6.3 Output:
Go to Application Metrics and obtain Throughput value for all the samples from the saved
Excel files and make a comparison chart as shown. Use Excel Insert Chart option and
then select chart type as Line chart.
Comparison Chart:
Distance (m)
5
10
15
20
25
30
35
40
45
50
55
60
Throughput (Mbps)
5.843504
5.837664
5.85752
5.85635
3.65467
1.67024
1.69907
1.69907
1.66556
1.66790
1.65972
1.66323
38
6.4 Inference
Throughput (Mbps)
7
6
5
4
3
2
1
0
0
10
20
30
40
50
60
70
Distance
*** All the above plots highly depend upon the placement of nodes in the simulation
environment. So, note that even if the placement is slightly different, the same set of values
will not be got but one would notice a similar trend.
We notice that as the distance increases, the throughput decreases. This is because the
underlying data rate depends on the received power at the receiver. Received power is
directly proportional to (1 / distance).
In 802.11b, four data rates, 1 Mbps, 2 Mbps, 5.5 Mbps, and 11 Mbps, are supported. The rate
is decided based on the received power and the errors in the channel. Note a higher data rate
does not necessarily yield a higher throughput since packets may get errored. Only when the
channel conditions are good, does a higher data rate give a higher throughput. In a realistic
WLAN environment, the channel condition can vary due to pathloss, fading, and shadowing.
In NetSim to accommodate different channel conditions, rate adaptation is commonly
employed. The rate adaptation algorithms dynamically adjusts the modulation mode
and data rate to optimize performance when channel condition changes. So, when
NetSim detects that the number of errors in the channels are high, it automatically drops
down to a lower rate.
In addition, one must note that WLAN involves ACK packets after data transmission.. These
additional packet transmission lead to reduced Application throughput of 5.5 Mbps (at 1 20
mts range) even though the PHY layer data rate is 11 Mbps.
39
40
Shortest path:
OSPF allows administrator to assign a cost for passing through a link. The total cost of a
particular route is equal to the sum of the costs of all links that comprise the route. A router
chooses the route with the shortest (smallest) cost.
In OSPF, each router has a link state database which is tabular representation of the topology
of the network (including cost). Using dijkstra algorithm each router finds the shortest path
between source and destination.
Formation of OSPF Routing Table
1. OSPF-speaking routers send Hello packets out all OSPF-enabled interfaces. If two routers
sharing a common data link agree on certain parameters specified in their respective
Hello packets, they will become neighbors.
2. Adjacencies, which can be thought of as virtual point-to-point links, are formed between
some neighbors. OSPF defines several network types and several router types. The
establishment of an adjacency is determined by the types of routers exchanging Hellos
and the type of network over which the Hellos are exchanged.
3. Each router sends link-state advertisements (LSAs) over all adjacencies. The LSAs
describe all of the router's links, or interfaces, the router's neighbors, and the state of the
links. These links might be to stub networks (networks with no other router attached), to
other OSPF routers, or to external networks (networks learned from another routing
process). Because of the varying types of link-state information, OSPF defines multiple
LSA types.
4. Each router receiving an LSA from a neighbor records the LSA in its link-state
database and sends a copy of the LSA to all of its other neighbors.
5. By flooding LSAs throughout an area, all routers will build identical link-state databases.
6. When the databases are complete, each router uses the SPF algorithm to calculate a loopfree graph describing the shortest (lowest cost) path to every known destination, with
itself as the root. This graph is the SPF tree.
7. Each router builds its route table from its SPF tree
41
7.2 Procedure
Sample 1:
Step 1:
Go to Simulation New Internetworks
Step 2:
Click & drop Routers, Switches and Nodes onto the Simulation Environment and link them
as shown:
Step 3:
These properties can be set only after devices are linked to each other as shown above.
Set the properties of the Router 1 as follows:
42
Node Properties: In Wired Node H, go to Transport Layer and set TCP as Disable
Switch Properties: Accept default properties for Switch.
Link Properties: Accept default properties for Link.
Application Properties: Click and drop the Application icon and set properties as follows:
Sample 2:
To model a scenario, follow the same steps as given in Sample1 and set the Router A
properties as given below:
Link Properties:
Link Properties
Link 3
Uplink Speed
100
Downlink Speed
100
Link 4
Link 5
Link 6
Link 7
100
100
10
10
100
100
10
10
Node Properties: In Wired Node H, go to Transport Layer and set TCP as Disable
Switch Properties: Accept default properties for Switch.
Application Properties: Click and drop the Application icon and set properties as in Sample
1.
Simulation Time- 100 Sec
(Note: The Simulation Time can be selected only after doing the following two tasks,
44
45
After running Sample1, click RIP table in Performance Metrics screen. Then click the
respective router to view the Routing table.
Shortest Path from Wired Node H to WiredNode I in RIP (Use Packet Animation to view) :
WiredNode HSwitch FRouter1Router4Router5Switch GWired Node I
46
OSPF
The main operation of the OSPF protocol occurs in the following consecutive stages and
leads to the convergence of the internetworks:
1. Compiling the LSDB.
2. Calculating the Shortest Path First (SPF) Tree.
3. Creating the routing table entries.
Compiling the LSDB
The LSDB is a database of all OSPF router LSAs. The LSDB is compiled by an ongoing
exchange of LSAs between neighboring routers so that each router is synchronized with its
neighbor. When the Network converged, all routers have the appropriate entries in their
LSDB.
Calculating the SPF Tree Using Dijkstra's Algorithm
Once the LSDB is compiled, each OSPF router performs a least cost path calculation called
the Dijkstra algorithm on the information in the LSDB and creates a tree of shortest paths to
each other router and network with themselves as the root. This tree is known as the SPF Tree
and contains a single, least cost path to each router and in the Network. The least cost path
calculation is performed by each router with itself as the root of the tree
Calculating the Routing Table Entries from the SPF Tree
The OSPF routing table entries are created from the SPF tree and a single entry for each
network in the AS is produced. The metric for the routing table entry is the OSPF-calculated
cost, not a hop count.
The OSPF table in NetSim
After running Sample 2, click OSPF Metrics in Performance Metrics screen. Then click
the router to view the Routing table
47
Shortest Path from Wired Node H to WiredNode I in OSPF (Use Packet Animation to view):
WiredNode HSwitch FRouter1Router2Router3Router5Switch G
WiredNode I
48
Where = Service Rate = 1/Service time and is the utilization given as follows,
To model an M/D/1 system in NetSim, we use the following model
49
Note:
1. Exponentially distributed inter-arrivals times give us a Poisson arrival process.
Different mean values are chosen as explained in the section Sample Inputs.
(Dropping the devices in different order may change the result because the random
number generator will get initialized differently)
2. To get constant service times, we use constant distribution for packet sizes. Since, the
service (which in our case is link transmission) times are directly proportional to
packet size (greater the packet size, greater the time for transmission through a link), a
constant packet size leads to a constant service time.
Procedure:
Create Scenario: Simulation New Internetworks.
Nodes 1 and Node 2 are connected with Router 1 by Link 1 and Link 2 respectively. Set the
properties for each device as given below,
Sample 1:
Application Properties: Click and drop the Application icon and set following properties:
Application Type
Custom
Source_Id
Destination_Id
Packet Size
Distribution
Constant
Value (bytes)
1250
Distribution
Exponential
2000
50
Link Properties
Link 1
Link 2
10
10
10
10
Uplink BER
Downlink BER
Downlink
Propagation
Delay
(ms)
Router Properties: Accept the default properties for Router.
Simulation Time: 100 Sec
Observation:
Even though the packet size at the application layer is 1250 bytes, as the packet moves down
the layers, some overhead is added which results in a greater packet size. This is the actual
payload that is transmitted by the physical layer. The overheads added in different layers are
shown in the table:
Layer
Overhead
(Bytes)
Transport Layer
Network Layer
20
51
MAC layer
26
Physical Layer
Total
54
8.2 Output:
After running the simulation, check the Delay in the Application Metrics.
Delay = 2656.855 micro sec
52
This Delay (also known as Mean Delay) is the sum of Queuing Delay, Total Transmission
time and Routing Delay.
(
Total Transmission Time is the sum of transmission time through Link 1 and Link 2.
Transmission time through each link is the same and is given by:
Transmission time through each link =
=
= 1043.2 micro sec
Routing Delay is approximately 1 micro sec and can be found from the Event Trace. It is the
difference between Physical In and Physical Out time for the Router.
Therefore, for simulation
Queuing Delay = 2656.855 (2 1043.2) 1 = 569.455 micro sec
Sample 2
Keeping all the other parameters same as in previous example, if Packet Inter Arrival Time is
taken as 1500 micro sec, then
= 666.67 packets per sec
Utilization = / = 666.67/958.59 = 0.695
And Queuing Time T = 1188.56 micro sec
From NetSim,
Delay = 3279.297 micro sec
Therefore, Queuing Time = 3279.298 - (21043.2) 1
= 1191.898 micro sec
53
Note: Obtained value is slightly higher than the theoretical value because of initial delays in
forming ARP table, Switch table and Routing table etc.
A Note on M/M/1 queuing in NetSim
M/M/1 queue can be generated similarly by setting the Packet Size Distribution as
Exponential instead of Constant. However, the results obtained from simulation deviate
from the theoretical value because of the effect of packet fragmentation. Whenever a packet
with size greater than Transport Layer MSS and / or MAC Layer MTU (which is 1500 bytes
in NetSim) is generated, it gets fragmented in the application layer. Then the packet is sent as
multiple frames, and makes it impossible to calculate the exact queuing time.
54
Slotted ALOHA:
In slotted Aloha, time is divided up into discrete intervals, each interval corresponding to one
frame. In Slotted ALOHA, a computer is required to wait for the beginning of the next slot in
order to send the next packet. The probability of no other traffic being initiated during the
entire vulnerable period is given by
which leads to
frame time) is the mean of the Poisson distribution with which frames are being generated.
For reasonable throughput S should lie between 0 and 1.
G is the mean of the Poisson distribution followed by the transmission attempts per frame
time, old and new combined. Old frames mean those frames that have previously suffered
collisions.
It is easy to note that Slotted ALOHA peaks at G=1, with a throughput of
or about
0.368. It means that if the system is operating at G=1, the probability of an empty slot is
0.368
Where,
PT
55
ST
The throughput (in Mbps) per packet time can be obtained as follows:
Where,
PT
PS
In the following experiment, we have taken packet size=1472 (Data Size) + 28 (Overheads) =
1500 bytes
Bandwidth is 10 Mbps and hence, packet time comes as 1.2 milliseconds.
9.2 Procedure:
Step 1:
How to Create Scenario:
56
Sample Inputs:
Input for Sample 1: Node 1 generates traffic. The properties of Node 1 which transmits data
to Node 2 are selected as follows:
Wireless Node Properties:
Wireless Node Properties
Transport Layer
TCP
disable
Interface1_Wireless
Slot Length(mus)
1500
Data Rate(mbps)
10
Right click on the Grid environment and select the channel characteristics as no path loss.
Application Properties: Click and drop the Application icon and set following properties as
shown in below figure:Application Type
Custom
Source_Id
Destination_Id
Packet Size
Distribution
Exponential
Value (bytes)
1472
Distribution
Exponential
20000
57
Obtain the values of Throughput and Total Number of Packets Transmitted from the
statistics of NetSim simulation for various numbers of traffic generators.
Input for Sample 2: Node 1 and Node 2 both generate traffic. Node 1 transmits data to Node
2 & Node 2 transmits data to Node 1.The properties of Node 1 and Node 2 are set as shown
in Sample 1.
Input for Sample 3: 3 Nodes are generating traffic. Node 1 transmits data to Node 2, Node 2
transmits data to Node 3 and Node 3 transmits data to Node 1.
And so on continue the experiment by increasing the number of nodes generating traffic as 4,
5, 7, 9, 10, 15, 20 22 and 24 nodes.
Comparison Table:
The values of Throughput and Total Number of Packets Transmitted obtained from the
network statistics after running NetSim simulation are as follows. Throughput per packet
time and Number of Packets Transmitted per packet time calculated from the above
mentioned formulae are tabulated as below:
Number of
nodes
generating
traffic
Total
Throughput
Throughput number of
per packet
(in Mbps)
Packets
time
Transmitted
0.58
793
1.06
1602
1.47
2394
1.8
3164
2.01
3913
58
Number of
Packets
Transmitted
per packet
time
0.058
0.095
0.106
0.192
0.147
0.287
0.18
0.379
0.201
0.469
2.43
5531
2.64
7101
10
2.74
7824
15
2.74
11695
20
2.43
15606
22
2.3
17288
24
2.14
18884
0.243
0.663
0.264
0.852
0.274
0.938
0.274
1.403
0.243
1.872
0.23
2.074
0.214
2.266
Thus the following characteristic plot for the Slotted ALOHA is obtained, which matches the
theoretical result.
Slotted Aloha
0.3
0.25
0.2
0.15
0.1
0.05
0
0.05
0.55
1.05
1.55
2.05
Note: The optimum value is slightly less than the theoretical maximum of 0.368 because
NetSims simulation is per real-world and includes overheads, inter-frame gaps etc.
59
For example, a transmission might have a BER of 10-5, meaning that on average, 1 out of
every of 100,000 bits transmitted exhibits an error. The BER is an indication of how often a
packet or other data unit has to be retransmitted because of an error.
Unlike many other forms of assessment, bit error rate, BER assesses the full end to end
performance of a system including the transmitter, receiver and the medium between the two.
In this way, bit error rate, BER enables the actual performance of a system in operation to be
tested.
Bit error probability (pe): The bit error probability is the expectation value of the BER. The
BER can be considered as an approximate estimate of the bit error probability. This estimate
is accurate for a long time interval and a high number of bit errors.
It is based on the assumption that the bit errors are independent of each other.
60
10.2 Procedure:
How to create a scenario and generate traffic:
Example 1:
Create samples by varying the bit error rate (10-6, 10-7, 10-8, 10-9, No error) and check
whether packet error output matches the PER formula.
Sample Inputs:
To perform this sample experiment, two nodes and one hub are considered.
61
The properties of Node 1 and Hub are as follows: (Node 2 has default properties)
Link Properties
Sample 1 Sample 2
Sample 3
Sample 4
Sample 5
10
10
10
10
10
No Error
10-9
10-8
10-7
10-6
62
Example 2:
Sample Inputs:
In this sample experiment, four nodes and one hub are considered.
Link Properties
Sample 1 Sample 2
Sample 3
Sample 4
Sample 5
10
10
10
10
10
No Error
10-9
10-8
10-7
10-6
The properties of Node 1 are same as in Example 1 and Node 2 properties are shown below:
(Node 3 and Node 4 have default properties)
Application Properties: Click and drop the Application icon and set the properties as in
example 1.
Simulation Time - 10 Sec
(Note: The Simulation Time can be selected only after the following two tasks,
Packets
Errored
0
0
1
6
46
Packets
Generated
3999
3999
3999
3999
3999
63
Packets
Errored
0
1E-09
1E-08
1E-07
1E-06
0
0
1
11
86
Packets
Generated
7998
7998
7998
7998
7998
Packet size for the calculation of the output table=1500 bytes or 12000 bits
100
90
80
Packets Errored
70
60
50
40
30
20
10
0
No Error
10^-9
10^-8
10^-7
10^-6
10.3 Inference:
From the Graph, we see that as the error rate is increased the number of errored packets
increase. The increase is exponential since the error rate is increased in powers of 10.
64
65
When a station
becomes ready to send, it senses the channel. If it is idle, it transmits with a probability of p.
With a probability q=1-p it defers until the next slot. If that slot is also idle, it either transmits
or defers again, with probabilities p and q respectively. This process is repeated until either
the frame has been transmitted or another station has begun transmitting. In the latter case, it
acts as if there had been a collision (i.e., it waits a random time and starts again). If the station
initially senses the channel busy, it waits until the next slot and applies the above algorithm.
How does the performance of LAN (throughput) that uses CSMA/CD protocol gets
affected as the numbers of logged in user varies:
Performance studies indicate that CSMA/CD performs better at light network loads. With the
increase in the number of stations sending data, it is expected that heavier traffic have to be
carried on CSMA/CD LANs (IEEE 802.3). Different studies have shown that CSMA/CD
performance tends to degrade rapidly as the load exceeds about 40% of the bus capacity.
Above this load value, the number of packet collision raise rapidly due to the interaction
among repeated transmissions and new packet arrivals. Collided packets will back off based
on the truncated binary back off algorithm as defined in IEEE 802.3 standards. These
retransmitted packets also collide with the newly arriving packets.
11.2 Procedure:
How to create a scenario and generate traffic:
Scenario:
66
Sample Input:
In this Sample experiment 12 Nodes and 1 Hubs need to be clicked and dropped onto the
Environment Builder.
Input for the Sample experiments (i.e. Totally 11 Samples) are given below,
Sample Input 1:
In the first sample for each Node the following properties have to be set,
Node Properties
Values to be Selected
Persistence
Vary persistence from 1/2, 1/3, 1/4, 1/5 1/10, 1/11 to generate other experiments.
Create broadcast application for all nodes and set the properties as follows:
Application Properties
Distribution
Constant
1472
Distribution
Exponential
1000
Packet Size
Link Properties
Values to be
Selected
67
11.3 Output:
After simulation of each experiment, click on the network statistics and note down the user
level throughput values. Open an excel sheet and plot a graph for these noted values against
their respective persistence values.
Comparison Chart:
Throughput(Mbps)
7.8
Performance Graph
7.6
7.4
Optimum
7.2
7
6.8
6.6
6.4
1/2
1/3
1/4
1/5
1/6
1/7
1/8
Persistance
11.4 Inference:
As the number of logged in users is quite large in this experiment, the performance of a ppersistent CSMA/CD network with large p, is not optimal because of a large number of
collisions. Therefore, we have minimum throughput when the persistence was 1/2. But as
persistence is decreased (lower and lower probabilities), the likelihood of collisions reduce
and hence throughput starts to increase. However, beyond a certain limit, in this case 1/11 the
probability of transmitting packets becomes very low and hence there arent many
transmissions. Therefore, throughput starts to decline. In this experiment with 12 nodes
generating traffic, we notice that the maximum throughput is at a persistence value lying
between 1/9 and 1/12.
68
12.1 Theory:
Mobile Ad-Hoc Network (MANET) is a self-configuring network of mobile nodes connected
by wireless links to form an arbitrary topology without the use of existing infrastructure. The
nodes are free to move randomly. Thus the network's wireless topology may be unpredictable
and may change rapidly.
The node density also has an impact on the routing performance. With very sparsely
populated network the number of possible connection between any two nodes is very less and
hence the performance is poor. It is expected that if the node density is increased the
throughput of the network shall increase, but beyond a certain level if density is increased the
performance degrades.
Throughput: It is the rate of successfully transmitted data packets in unit time in the
network during the simulation.
Average Delay: It is defined as the average time taken by the data packets to propagate
from source to destination across a MANET. This includes all possible delays caused by
routing discovery latency, queuing at the interface queue, and retransmission delays at the
MAC, propagation and transfer times.
69
12.3 Procedure:
In NetSim, Select Simulation New Advanced Wireless Networks MANET.
Step 1: Create /Design the Network
Devices Required: 2 Wireless Nodes
Step 2: Configure the Network (Sample 1)
Wireless Node Properties:
X-Coordinate
Y-Coordinate
50
100
100
150
NOTE: To edit the position, change the (x, y) co-ordinates in Global Properties as shown:
To change
Co-ordinates,
click & edit
70
Channel Characteristics
Line of Sight
Path loss is the reduction in the power density of radio wave as it travels. The loss is
proportional to (distance) to the power (n), where n is the path loss exponent. The general
value of n is from 2 to 5. As the value of n is increased there will be more reduction in power
and hence higher likelihood of error in the packet. In general, users would notice that as n
increases the error increases, the data rate decreases and the throughput decreases.
Step 3: Model Traffic in the Network (Sample 1)
Select the Application Button and click on the gap between the Grid Environment and the
ribbon. Now right click on Application and select Properties.
71
Application Properties:
Application Type Custom
Source ID
1 (Wireless Node A)
Destination ID
2 ( Wireless Node B)
Packet Size
Distribution
Constant
Value(Bytes)
1460
Constant
Value(s)
60000
Step 4: Simulate
Simulation Time - 100 Sec
After completion of the experiment, Save the experiment for future analysis of results.
72
Step 2: Specify the Experiment Name and Save Path and click on OK
Click & drop 2 more Wireless Nodes onto the Simulation Environment.
Wireless Node
X-Coordinate
Y-Coordinate
50
100
100
150
75
75
125
125
73
Application Properties:
Application Type Custom
Custom
Source ID
1 ( Wireless Node A)
3 ( Wireless Node C)
Destination ID
2 ( Wireless Node B)
4 ( Wireless Node D)
Packet Size
Distribution
Constant
Constant
Value(Bytes)
1460
1460
Constant
Constant
Value(s)
60000
60000
Step 7: Simulate
Simulation Time - 100 Sec
After completion of the experiment, Save the experiment for future analysis of results.
Step 8: Configure the Network (Sample 3)
Wireless Node Properties:
Click & drop 2 more Wireless Nodes onto the Simulation Environment.
74
X-Coordinate
Y-Coordinate
50
100
100
150
80
70
140
130
110
40
160
90
Select the Application Button and click on the gap between the Grid Environment and
the ribbon. Now right click on Application and select Properties.
Application Properties:
Application Type Custom
Custom
Custom
Source ID
1 ( Wireless Node A)
3 ( Wireless Node C)
5 ( Wireless Node E)
Destination ID
2 ( Wireless Node B)
4 ( Wireless Node D)
6 ( Wireless Node F)
Packet Size
Distribution
Constant
Constant
Constant
Value(Bytes)
1460
1460
1460
Constant
Constant
Constant
Value(s)
60000
60000
60000
75
12.4 Output
Go to Simulation Open Metrics menu to open the results of saved experiments.
Go to Application metrics and compute the sum of all column wise values of throughput.
Throughput = Sum of throughputs obtained from all Applications
Go to Application metrics and compute the Average delay by taking average of all row
wise values of Delay.
Delay = Average delay obtained from all Applications
Plotting the Throughput obtained from the above 3 samples with respect to Number of Nodes
and the graph which is obtained, follows the pattern as below:
76
0.5
Throughput (Mbps)
0.4
0.3
0.2
0.1
0
0
No. of Nodes
Plot the Average Delay obtained from the above 3 samples with respect to Number of Nodes
and the graph obtained is similar to:
35
30
25
20
15
10
5
0
No. of Nodes
12.5 Inference
As the number of nodes increases (2 4 6) the throughput of the network increases
because the channel is able to handle additional network traffic. However, if the number of
nodes is increased further, the throughput may decreases as the network traffic is too high,
and this leads to collisions.
As the number of nodes increases, the delay also increases as it takes more time for a packet
to reach its destination.
77
Throughput: It is the rate of successfully transmitted data packets in unit time in the
network during the simulation.
13.3 Procedure:
In NetSim, Select Simulation New Advanced Wireless Networks MANET.
78
Wireless Node
X-Coordinate
Y-Coordinate
100
50
100
150
200
150
200
50
100
100
200
100
Change Mobility model to RANDOM_WALK and set velocity 10 m/s for all nodes.
79
Channel Characteristics
Line of Sight
Path loss is the reduction in the power density of radio wave as it travels. The loss is
proportional to (distance) to the power (n), where n is the path loss exponent. The general
value of n is from 2 to 5. As the value of n is increased there will be more reduction in power
and hence higher likelihood of error in the packet. In general, users would notice that as n
increases the error increases, the data rate decreases and the throughput decreases.
NetSim provides various propagation models such as fading only, fading and shadowing and
line of sight.
In Line of sight, sender and receiver have an unobstructed path between them. The reduction
in signal power is only due to the path loss explained above.
In fading only, signal can take many different paths between sender and receiver due to
reflection, scattering, diffraction and others.
In fading and shadowing, apart from fading then received signal is shadowed by obstructions
such as hills and buildings.
Step 3: Model Traffic in the Network (Sample 1)
Select the Application Button and click on the gap between the Grid Environment and the
ribbon. Now right click on Application and select Properties.
Application Properties:
Application Type Custom
Custom
Custom
Source ID
1 (Wireless Node A)
2 ( Wireless Node B)
5 ( Wireless Node E)
Destination ID
4 ( Wireless Node D)
3 ( Wireless Node C)
6 ( Wireless Node F)
Packet Size
Distribution
Constant
Constant
Constant
Value(Bytes)
1460
1460
1460
Constant
Constant
Constant
Value(s)
20000
20000
20000
80
Step 4: Simulate
Simulation Time - 100 Sec
After completion of the experiment, Save the experiment for future analysis of results.
81
13.4 Simulate
Simulation Time - 100 Sec
After completion of experiment, Save the experiment, for future analysis of results. Users
can view the mobility of the nodes and flow of packets clearly using packet animation.
1.5
Throughput (Mbps)
1
0.5
0
0
10
20
30
40
82
50
60
13.6 Inference
As the mobility of nodes increases, the throughput decreases. This is because as the velocity
increases, more packets get lost in lieu of ad hoc movement of the nodes. The packet delivery
ratio decreases as the sum of total packets received decreases with increased mobility.
NOTE: The results are highly dependent on position/velocity/ traffic etc given the inherent
characteristics of MANET protocols. Any modifications with the above mentioned input
parameters will change the final output result.
83
14.2 Procedure:
Step 1:
Go to Simulation New BGP Networks
Sample Inputs:
Follow the steps given in the different samples to arrive
at the objective.
84
Wired Node E and Wired Node F are connected by Link 1 and Link 2 to Router C.
Router D is connected by Link 6 and Link 7to Wired Node G and Wired Node H
respectively.
Application Properties
Application 1
Application 2
CUSTOM
CUSTOM
Source_Id
Destination_Id
Application_Type
Constant
Constant
1472
1472
Constant
Constant
20000
20000
Link Properties
Bit Error Rate
(BER)
Downlink Speed
Link 1
Link 2
Link 3
Link 4
Link 5
Link 6
8.448
8.448
10
1000
10
8.448
8.448
8.448
8.448
10
1000
10
8.448
8.448
(Mbps)
Uplink Speed
(Mbps)
85
Link 7
Sample 1:
If selected internal gateway protocol is RIP then Router properties are as follows:
Router Properties
Border_ Router A
Border_ Router B
Exterior
Routing
table
BGP
Interior
Routing
table
RIP
Exterior Routing
table
Protocol Type
Interior
Routing
table
RIP
Update Timer
30
30
Timeout Timer
180
180
Garbage
Collection Timer
120
120
BGP
Router Properties
Router C
Router D
Routing Protocol
RIP
RIP
Update Timer
Timeout Timer
Garbage Collection Timer
30
180
120
30
180
120
Border_ Router A
Border_ Router B
Exterior
Routing
table
BGP
Interior
Routing
table
OSPF
Exterior Routing
table
Protocol Type
Interior
Routing
table
OSPF
LSRefreshTime
1800
1800
MaxAge
3600
3600
86
BGP
Router Properties
Router C
Router D
Routing Protocol
OSPF
OSPF
LSRefreshTime
MaxAge
1800
3600
1800
3600
14.3 Output:
After running this scenario, in Performance Metrics screen, routing tables are obtained in
BGP table and RIP metrics.
If you click over the RIP metrics, you will get the RIP routing table for internal routers. If
you click over the BGP table, you will get the routing table for Border routers. We have
shown the routing tables for Border Router 1 and 2.
87
The Border Routers stores the nodes remote address in its Routing Table as shown in the
above Tables under PeerRemoteAddr column.
Output: (Sample 2)
After running this scenario, in Performance Metrics screen, routing tables are obtained in
BGP table and OSPF metrics.
If you click over the OSPF metrics, you will get the OSPF routing table for internal routers. If
you click over the BGP table, you will get the routing table for Border routers. We have
shown the routing tables for Border Router 1 and 2.
88
14.4 Inference:
First the internal Routing tables (RIP/OSPF table) are formed among all the Routers. The
Border Routers contains the network address of the next hop and the destination nodes as
represented in the routing table. Border Routers communicate with each other by passing
their Routing tables resulting in the formation of external Routing tables (BGP table). Then
actual packet transmission takes place from Source to Destination.
89
Follow the steps given in the different samples to arrive at the objective.
In this Experiment,
90
In the Sample 1, two Applications are run. After dropping Application on the Environment
menu, add application 2 from the left pane and change the following properties:
Application Properties
Application 1
Application2
Application type
Erlang_call
Erlang_call
Source_Id
Destination_Id
Duration_ Distribution
Exponential
Exponential
Duration(s)
60
60
10
10
IAT_ Distribution
Exponential
Exponential
Call
Codec
Codec
Custom
Custom
Service Type
CBR
CBR
Packet Size
33
33
20000
20000
Likewise, increase the number of MS by 2 upto 20 and set properties for different Samples by
adding an application every time and changing Source_Id and Destination_Id.
Simulation Time 100 sec
15.2 Output
To view the output, go to the Cellular Metrics.
In MS metrics, add the call blocked and call generated column. Call blocking probability is
calculated as ratio of Total call blocked to Total call generated.
Comparison Charts:
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
1
5
6
Sample Number
*** All the above plots highly depend upon the placement of Mobile station in the simulation
environment. So, note that even if the placement is slightly different the same set of values
will not be got but one would notice a similar trend.
92
15.3 Inference:
When the number of MS is increased from 4 to 20 the call blocking probability increases
from 0 to 0.94. As we increase the number of mobile stations more calls are generated. This
increases the traffic load on the system & more calls generated implies more channel requests
arrive at the base station but the number of channels is fixed. So when the base station does
not find any free channel the call is blocked.
An additional observation is that the call blocking is zero until 8 MS. This is because the
number of channels is sufficient to handle all call that 6 MS may generate. Only after this the
base station does not find free channels and blocks calls.
93
Total no of MS used: 60
Sample 1: Drop 1 BTS, 1 MSC and 60 MS and interconnect them in no specific order.
94
Application
Properties
Application
1
Application
2
Application Application
3
4
Application
5
Source_Id
11
Destination_Id
10
12
All other
Properties
Default
Default
Default
Default
Default
Likewise add 25 more applications (totaling 30) with above properties and Source_Id13 to
Destination_Id 14 for application 6 and Source_Id 61 to Destination_Id 62 for application
30.
We have considered MSC to be device ID 1, and BTS as device ID 2.
Simulation Time 500 sec
Set Packet Animation to Dont play/record animation (Simulation will run fast) and click
OK. If record animation option is selected, the simulation may take a long time to complete.
Sample 2:
Keep all properties same as Sample 1 and in the BTS properties, change the voice activity
factor to 0.9 as shown:
95
Sample 3 and so on: Change the voice activity factor to 0.8 in sample 3, 0.7 in sample 4.
and to 0.1 in sample 10 in BTS properties.
16.2 Output
To view the output, go to the Cellular Metrics.
In Channel metrics, the channel count is mentioned.
For every sample plot the graph.
Comparison Charts and Inference:
450
400
Channel Count
350
300
250
200
150
100
50
0
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
When the system Voice activity factor decreases from 1.0 to 0.1, the number of channels
increases from 43 to 427.
96
In CDMA network, the number of channels is inversely proportional to the voice activity
factor.
1
graph. (This is because VAF is decreasing along +ve X)
x
In MS metrics, the call generated and call blocked is shown for each MS. Add all the calls
generated to obtain Total call generated, and add calls blocked for all MS Ids to obtain Total
call blocked.
Calculate call blocking probability as ratio of Total call blocked to Total call generated.
0.5
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
When voice activity factor is decreased the number of channels available increases. Thus the
system has more number of channels to handle the same number of calls (Note - Number of
MS is constant and their properties are same across all experiments. So, they generate
approximately same number of calls throughout). As the number of channels increases the
call blocking probability decreases.
97
98
Theoretical Analysis:
If SuperFrame Order (SO) is same as Beacon Order (BO) then there will be no inactive
period and the entire SuperFrame can be used for packet transmissions.
If BO=10, SO=9 half of the SuperFrame is inactive and so only half of SuperFrame duration
is available for packet transmission. If BO=10, SO=8 then (3/4)th of the SuperFrame is
inactive and so nodes have only (1/4)th of the SuperFrame time for transmitting packets and
so we expect throughput to approximately drop by half of the throughput obtained when
SO=9.
Percentage of inactive and active periods in SuperFrame for different SuperFrame Orders is
given below:
Beacon
Order (BO)
SuperFrame
Order (SO)
Active part
ofSuperFrame(%
)
Inactive part of
SuperFrame (%)
Throughput
estimated (%)
10
10
100
> 200% of T
10
50
50
Say T = 20.18
10
25
75
50 % T
10
12.5
87.5
25 % T
10
6.25
93.75
12.5 % of T
10
3.125
96.875
6.25 % of T
10
1.5625
98.4375
3.12% of T
10
0.78125
99.21875
1.56 % of T
We expect throughput to vary in the active part of the SuperFrame as sensors can transmit a
packet only in the active portion.
99
Simulation:
How to Create Scenario & Generate Traffic:
In NetSim, Go to Simulation New Wireless Sensor Networks
In grid settings, enter side length as 100 m and select sensor placement strategy as Via click
& drop
Click & drop one Sensor Node, Sink Node and Agent onto the Simulation Environment:
Values
Velocity(m/s)
0
Interface1_Zigbee: Sensor
3
Sink Node Properties: Change the following properties for PAN Coordinator.
Sink Node Properties
Values
Enable
Beacon Order
10
10
Sample 2 and so on: Vary the Super Frame Order for every sample (SuperFrame order = 9
for sample 2, and, 3 for sample 8).
The following are the throughputs obtained from simulation for different SuperFrame Orders.
SuperFrame Throughput
Order
(Kbps)
10
39.6
21.03
10.08
5.04
2.50
1.24
0.60
0.28
Note: To obtain throughput from simulation, payload transmitted values will be obtained
from Network statistics and calculated using following formula:
Comparison Chart:
45
Throughput (kbps)
40
35
30
25
20
Simulated
15
Theoritical
10
5
0
10
Superframe Order
101
*** All the above plots highly depend upon the placement of Sensor in the simulation
environment. So, note that even if the placement is slightly different the same set of values
will not be got but one would notice a similar trend.
17.2 Inference:
From the comparison chart both the simulation and theoretical throughputs match except for
the case with no inactive period. A sensor will be idle if the last packet in its queue is
transmitted. If a packet is generated in inactive period then the packet has to wait in the queue
till the next SuperFrame so sensor has packets waiting in its queue and so it cannot be idle in
the next SuperFrame, but if there is no inactive period then there might be no packets waiting
in the queue and so sensor can be idle resulting in lesser throughput.
102
18.1 Introduction:
IEEE Standard 802.15.4 defines the protocol and compatible interconnections for data
communication devices using low-data-rate, low-power, and low-complexity short-range
radio frequency (RF) transmissions in a wireless personal area network (WPAN). In Wireless
sensor network IEEE 802.15.4 standard is used in MAC and PHY layers.
IEEE 802.15.4 PHYs provide the capability to perform CCA in its CSMA-CA mechanism.
The PHYs require at least one of the following three CCA methods: Energy Detection over a
certain threshold, detection of a signal with IEEE 802.15.4 characteristics or a combination of
these methods.
18.2 Theory:
A packet transmission begins with a random backoff (in number of slots, each slot of 20
duration) which is sampled uniformly from 0 to
and followed by a
CCA.
CCA failure starts a new backoff process with the backoff exponent raised by one, i.e., to
macminBE+1, provided it is lesser than the maximum backoff value given by
macmaxBE.
Maximum number of successive CCA failures for the same packet is governed by
macMaxCSMABackoffs, exceeding which the packet is discarded at the MAC layer.
A successful CCA is followed by the radio turnaround time and packet transmission.
103
If the receiver successfully receives the packet i.e., without any collision or corruption
due to PHY layer noise, the receiver sends an ACK after the radio turnaround time.
The transmitter infers that the packet has failed after waiting for macAckWaitDuration
and retransmits the packet for a maximum of aMaxFrameRetries times before discarding
it at the MAC layer.
Note: In NetSim the radio turnaround time after a CCA success is not considered.
18.3 Procedure
How to Create Scenario:
In NetSim, Select Simulation New Zigbee Networks
Create the scenario as shown:
Zigbee Node B
Global Properties
X_Coordinate
15
Y_Coordinate
20
Enable
MaximumFrameRetries
104
Node Properties
Zigbee Node C
Global Properties
X_Coordinate
25
Y_Coordinate
20
Enable
MaximumFrameRetries
Values
Global Properties
X_Coordinate
20
Y_Coordinate
20
Beacon Mode
Environment Properties:
Environment Properties
Values
Channel Characteristics
No Path Loss
Custom
Source_Id
2 (Zigbee Node B)
Destination_Id
3 (Zigbee Node C)
Packet_Size
Distribution
Constant
Value(Bytes)
70
105
Inter_Arrival_time
Distribution
Constant
Value(micro sec)
4000
(Note: If the size of the packet size at the Physical layer is greater than 127 bytes, the packet
gets fragmented. Taking into account the various overheads added at different layers (which
are mentioned below), the packet size at the application layer should be less than 80 bytes.)
Simulation Time: 100 Sec
Throughput obtained from the simulation is 100.408kbps (0.100408 Mbps)
Note: This throughput is obtained when the nodes are placed at the closest possible distance
from the PAN coordinator. As the distance is increased, the throughput would reduce.
Theoretical Analysis:
We have set the Application layer payload as 70 bytes in the Node1 properties and when the
packet reaches the physical layer various other headers gets added like
App layer Payload
70 bytes
8 bytes
28 bytes
MAC Header
5 bytes
PHY Header
6 bytes
Packet Size
117 bytes
106
117 bytes
3.5
Slots
0.4 0.6
Slots Slots
Random
Turn around
CCA
backoffAvg
Time
[0, 7]
11.7 Slots
Packet
0.6 0.6
Slots Slots
Turn Ack
around
Time
Source Node
Destination
Node
From IEEE standard, each slot has 20 Symbols in it and each symbol takes 16s for
transmission:
16 s
Symbol Time
Slot Time
20 *
0.32 ms
3.5 *
1.12 ms
CCA
0.4 *
0.l28 ms
Turn-around-Time
0.6 *
0.192 ms
11.7 *
3.744 ms
Turn-around-Time
0.6 *
0.192 ms
0.6 *
0.192 ms
Total Time
17.4 *
5.568ms
18.4 Inference:
Throughput from simulation
100.408 kbps
100.574 kbps
107
Throughput from theoretical analysis matches the results of NetSims discrete event
simulation.
(Note: The slight difference in throughput is due to fact that the average of random numbers
generated for backoff need not be exactly 3.5 as the simulation is run for short time and also
in Network layer DSR protocol is running, so route setup process will take some time.)
As we go on increasing the simulation time, the throughput value obtained from simulation
approaches the theoretical value as can be seen from the table below:
Simulation Time (sec)
Throughput (kbps)
10
99.680
50
100.486
100
100.408
200
100.486
Note: In NetSim Academic version to run the simulation with 200 sec simulation time we
can use CLI.
108
Throughput: It is the rate of successfully transmitted data packets in unit time in the
network during the simulation.
Spectral Efficiency: It refers to the information rate that can be transmitted over a given
bandwidth in a specific communication system. It is a measure of how efficiently a
limited frequency spectrum is utilized by the physical layer protocol, and sometimes by
the media access control protocol.
109
19.3 Procedure:
How to Create Scenario & Generate Traffic:
Step 1: Go to Simulation New Cognitive Radio
Step 2: Click & drop 1 Base Station, 1 Incumbent and 2 CR CPE onto the Simulation
Environment. Connect the 2 CR-CPE and Incumbent with Base Station using Wireless Links.
To edit the position, change the (x, y) co-ordinates in Global Properties as shown:
To change
Co-ordinates,
click & edit
X-Coordinate
Y-Coordinate
100
120
120
100
Base Station
X-Coordinate
Y-Coordinate
100
100
Incumbent
X-Coordinate
Y-Coordinate
90
90
Note- Set Incumbent location by dropping at (90, 90) coordinates on grid environment.
110
Step 3:
Base Station Properties: In Interface_CR properties, under the Incumbent1 section, Set
Operational_Frequency_Start (MHz) = 54
Operational_Frequency_End (MHz) = 60
Operational_Time(s) = 10
Operational_Interval(s) = 0
Keepout_Distance(m) = 100
Under the Physical Layer section, Set
Min_Frequency = 54
Max_Frequency = 60
Step 4:
Application Properties:
To add application, drop the Application icon. Edit the Application properties as given in
table. All other properties are default.
111
Application Properties
Application 1
Application Type
Custom
Source ID
Destination ID
Note: Click on the Run Simulation icon and set simulation time only after doing the following
tasks:
Configure Applications.
Output:
After running the simulation, Experiment can be saved by clicking on the Save icon.
Open Export to MS Excel/.csv (.csv is comma separated value format, which is one of the
format used by MS Excel) by clicking as follows:
Click and
Export to .csv
(MS Excel)
Go to Application metrics in metrics file (.csv) and check the value of throughput.
Throughput = Throughput of the application.
Go to CR Channel metrics at the end in metrics file (.csv) and check the Spectral
Efficiency.
112
Sample 2:
Perform the same steps as in Sample 1 with following changes:
Change 1: Base Station Properties: In Interface_CR properties, under the Incumbent1
section, Set
Operational_Frequency_Start (MHz) = 54
Operational_Frequency_End (MHz) = 60
Operational_Time(s) = 10
Operational_Interval(s) = 5
Keepout_Distance(m) = 100
Under the Physical Layer section, Set
Min_Frequency = 54
Max_Frequency = 60
Sample 3:
Perform the same steps as in Sample 1 with following changes:
Change 1: Base Station Properties: In Interface_CR properties, under the Incumbent1
section, set
Operational_Frequency_Start (MHz) = 54
Operational_Frequency_End (MHz) = 60
Operational_Time(s) = 10
Operational_Interval(s) = 10
Keepout_Distance(m) = 100
Under the Physical Layer section, Set
Min_Frequency = 54
Max_Frequency = 60
113
Comparison Table:
Note: Open the saved experiments (Please Refer at the end of experiment) to obtain the
various Performance metrics and note the values obtained to compare as shown in table.
Throughput(mbps)
Sample 1
Sample 2
Sample 3
0.000000
0.137769
0.231224
Comparision of Throughput
0.25
Throughput
0.2
0.15
0.1
0.05
0
Sample 1
Sample 2
Sample 3
Spectral Efficiency-
Frequency(MHz)
Sample 1
Sample 2
Sample 3
Spectral efficiency
0.00001
0.12076
0.20124
Spectral Efficiency
0.25
0.2
0.15
0.1
0.05
0
Sample 1
Sample 2
114
Sample 3
19.4 Inference:
In both the samples, the Secondary User (CR-CPE) lies within the operational region of
Primary User (Incumbent), hence the frequency spectrum used by operational Primary User
(Incumbent) cannot be used by Secondary User (CR-CPE) for transmitting data. Both the
Primary User (Incumbent) and the Secondary User(CR-CPE) has been allocated the same
channel (frequency band of 54 - 60 MHz). Hence whenever Incumbent will use the allocated
channel, there will be no Spectrum Hole, and so the secondary user will not be able to
transmit any data during that time.
In the first sample, Operational Interval under Incumbent is set to zero i.e. the Incumbent will
continuously use the channel allocated to it. Hence there is no spectrum hole and throughput
of the data transmitted by secondary user and the spectral is approximately equal to zero.
In the second sample, the Primary User (Incumbent) is utilizing the frequency band of 54 - 60
MHz for 10 seconds after an interval of every 5 seconds. So the Secondary User(CR-CPE)
uses this allocated the frequency band of 54 - 90 MHz in an opportunistic manner i.e. during
the interval of 5 seconds when Incumbent is not utilizing the channel, a spectrum hole is
created and the CR-CPE will utilize it to transmit data. Hence the Throughput and Spectral
Efficiency is better compared to Sample1.
In the third sample, Operational Interval of Incumbent is set to 10. Hence the Secondary User
(CR-CPE) gets a bigger spectrum hole and hence Throughput and Spectral Efficiency is
better compared to other samples.
NOTE: The results are highly dependent on position/velocity/ traffic etc. Any modifications
with the above mentioned input parameters will change the final output result.
115
Throughput: It is the rate of successfully transmitted data packets in unit time in the
network during the simulation.
Spectral Efficiency: It refers to the information rate that can be transmitted over a given
bandwidth in a specific communication system. It is a measure of how efficiently a
limited frequency spectrum is utilized by the physical layer protocol, and sometimes by
the media access control protocol.
116
20.2 Procedure:
How to Create Scenario & Generate Traffic:
Sample 1:
Step 1: Go to Simulation New Cognitive Radio
Step 2: Click & drop 1 Base Station, 1 Incumbent and 2 CR CPE onto the Simulation
Environment. To edit the position, change the (x, y) co-ordinates in Global Properties as
shown:
To change
Co-ordinates,
click & edit
X-Coordinate
Y-Coordinate
100
120
120
100
BS
X-Coordinate
Y-Coordinate
100
100
Incumbent
X-Coordinate
Y-Coordinate
90
90
117
Step 3:
Base Station Properties: In Interface_CR properties, under the Incumbent1 section, Set
Operational_Frequency_Start (Mhz) = 54
Operational_Frequency_End (Mhz) = 60
Operational_Time(s) = 10
Operational_Interval(s) = 0
Keepout_Distance(m) = 100
Under the Physical Layer section, Set
Min_Frequency = 54
Max_Frequency = 60
Step 4:
Application Properties:
To add application, drop the Application icon. Edit the Application properties as given in
table. All other properties are default.
118
Application Properties
Application 1
Application Type
Custom
Source ID
Destination ID
Note: Click on the Run Simulation icon and set simulation time only after doing the following
tasks:
Configure Applications.
Output:
After running the simulation, Experiment can be saved by clicking on the Save icon.
Open Export to MS Excel/.csv (.csv is comma separated value format, which is one of the
format used by MS Excel) by clicking as follows:
Click and
Export to .csv
(MS Excel)
Go to Application metrics in metrics file (.csv) and check the value of throughput.
Throughput = Throughput of the application.
Go to CR Channel metrics at the end in metrics file (.csv) and check the Spectral
Efficiency.
119
Sample 2:
Perform the same steps as in Sample 1 with following changes:
Change1: Base Station Properties: In the Physical Layer section, Set
Min_Frequency = 54
Max_Frequency = 90
Comparison Table:
Note: Open the saved experiments (Please Refer at the end of experiment) to obtain the
various Performance metrics and note the values obtained to compare as shown in table.
Throughput(Mbps)
Sample 1
Sample 2
0.000000
0.583837
Spectral EfficiencySample 1
Frequency(MHz)
Spectral efficiency
54-60
0.00001
Sample 2
Frequency(MHz)
Spectral efficiency
54-60
0.00001
60-66
0.00000
66-72
0.00000
72-78
0.22668
78-84
0.00643
84-90
0.19400
120
20.3 Inference:
In both the samples, the Secondary User (CR-CPE) lies within the operational region of
Primary User (Incumbent), hence the frequency spectrum used by operational Primary User
(Incumbent) will not be used by Secondary User (CR-CPE).Also the Operational Interval
under Incumbent is set to zero ,i.e., the Incumbent will continuously use the channel allocated
to it.
In the first sample, both the Primary User (Incumbent) and the Secondary User (CR-CPE) has
been allocated the same channel (frequency band of 54 - 60 MHz). As Incumbent will
continuously use the channel allocated to it, so there will be no Spectrum Hole, hence the
secondary user will not be able to transmit any data in an opportunistic manner. Therefore the
throughput of the application in the CR-CPE and the spectral efficiency is almost equal to
zero.
In the second sample, the Primary User (Incumbent) has been allocated frequency band of 54
- 60 MHz and the Secondary User (CR-CPE) has been allocated the frequency band of 54 90 MHz. Incumbent will continuously use the channel allocated to it, but the rest channels
will remain free i.e. there will be Spectrum Hole, which the CR-CPE will utilize to transmit
data.
NOTE: The results are highly dependent on position/velocity/ traffic etc. Any modifications
with the above mentioned input parameters will change the final output result.
121
Where Gt and Gr are gains of transmitting and receiving antenna respectively. Here d is the
distance between transmitter and receiver, is the wavelength of the transmitted signal and
is reference distance at which channel gain becomes 1. n is path loss exponent and Pt is
transmitted power.
21.2 Procedure:
To create a LTE Scenario, go to Simulation
New LTE Networks.
122
Sample Inputs:
In this experiment, 1 Wired Node, 1 Router, 1 MME , 1 ENB and 1 UE is clicked and
dropped onto the Simulation environment from tool bar as shown below.
Sample 1:
These properties can be set only after devices are linked to each other as shown above.
Wired Node Properties:
Node Properties
Wired Node A
TCP
Router Properties: Default properties.
MME Properties: Default properties.
ENB Properties:
ENB Properties
ENB 4
Global Properties
X_Coordinate
Y_Coordinate
123
UE Properties:
UE Properties
UE D
Global Properties
X_Coordinate
50
Y_Coordinate
50
Velocity(m/s)
To run the simulation, drop the Application icon and change the following properties:
Application Properties
Application Type
Custom
Source ID
1 (Wired Node A)
Destination ID
5 (UE D)
Packet Size
Distribution
Constant
Value(Bytes)
1460
Constant
Value(s)
165
Wired Link 2
Wired Link 3
Wired Link 4
100
100
100
100
100
100
Uplink BER
Downlink BER
124
Wireless Link 1
Channel characteristics
Line of Sight
Set the properties for the Wired Node, Router, MME, UE, Wired, Wireless Links and
Application.
Set Packet Animation to Dont play/record animation (Simulation will run fast) and click
OK. If record animation option is selected, the simulation may take a long time to complete.
Upon completion of the experiment Save the experiment and note down the Application
throughput which is available in Application metrics for each sample case.
Sample 2:
Change the following properties in UE and run the simulation for 10 seconds as above. All
other properties are default.
125
UE Properties:
UE Properties
UE D
Global Properties
X_Coordinate
100
Y_Coordinate
100
Velocity(m/s)
(150,150)
Sample 4
(200,200)
Sample 5
(250,250)
Sample 6
(300,300)
Sample 7
(350,350)
Sample 8
(400,400)
Sample 9
(450,450)
And note down the throughput values from the Application metrics in each sample case.
21.3 Output:
Step 1: Distance calculation:
Calculate the Distance between ENB (x1, y1) and UE(x2, y2) as follows: (x2-x1)2+ (y2-y1)2
For example for Sample 1:
ENB (x1, y1) = (0, 0); UE(x2, y2) = (50, 50);
Distance = (50-0)2+ (50-0)2 = 2 50 = 502 meters.
Step 2: Open the Excel file and note down the distance between UE and ENB and throughput
values as shown in below table.
126
Sample nos.
1
2
3
Sample 4Number
5
6
7
8
Throughput (Mbps)
ENB (meters)
= 70.71
= 140.42
= 212.13
= 282.84
= 353.55
= 424.26
= 494.97
= 565.68
70.786
63.07
56.7
50.448
30.223
19.603
15.645
12.065
502
1002
1502
2002
2502
3002
3502
4002
Comparison Chart:
To draw these graphs by using Excel Insert Chart option and then select chart type as
Line chart.
80
Throughput (mbps)
70
60
50
40
30
20
10
0
70.71 140.42 212.13 282.84 353.55 424.26 494.97 565.68
Distance between UE and ENB(m)
21.4 Inference
As the distance increases between ENB and UE, throughput value is getting decreased. The
reason is if distance increases between the devices, the received signal power will decrease
due to high path loss.
127
22.2 Procedure:
o Create Scenario: Go to Simulation New LTE/LTE-A networks.
Sample Inputs:
In this experiment, 1 Wired Node ,1 Router, 1 MME , 1 ENB and 3 UE are clicked and
dropped onto the Simulation environment from tool bar as shown.
Sample 1:
Note: These properties can be set only after devices are linked to each other as shown above.
128
Wired Node A
TCP
ENB D
Inter_Band_Noncontingious_CA
1st CA
10
2nd CA
10
To run the simulation, drop the Application icon and change the following properties:
Application
Properties
Application Type
Custom
Custom
Custom
1 (Wired
1 (Wired
1 (Wired
Node A)
Node A)
Node A)
5(UE E)
6(UE F)
7(UE G)
Source ID
Destination ID
Packet Size
Distribution
Constant
Constant
Constant
Value(Bytes)
1460
1460
1460
129
Constant
Constant
Constant
Value(s)
146
146
146
UE Properties:
UE Properties
UE E
UE F
UE G
Global Properties
Velocity(m/s)
Wired Link 2
Wired Link 3
Wired Link 4
1000
1000
1000
1000
1000
1000
Uplink BER
Downlink BER
Wireless Link 1
Channel characteristics
No Path Loss
Set the properties for the Wired Node, Router, MME, UE, Wired, Wireless Links and
Application.
130
Upon completion of the experiment Save the experiment and note down the Application
throughputs of all applications which is available in Application metrics for each sample
case.
Sample 2:
Change the following properties in ENB and run the simulation for 10 seconds as above. All
other properties are default.
ENB Properties
ENB D
Inter_Band_Noncontingious_CA
1st CA
10
2nd CA
From Sample 3:
Change the ENB property, Channel Bandwidth to 10, 5, 3, 1.4 MHz (Refer below table)
ENB Properties
ENB D
Inter_Band_Noncontingious_CA
1st CA
5
2nd CA
And note down the throughput values from the Application metrics in each sample case.
131
22.3 Output
Step 1: Add the sum of all throughput values in each sample case:
Example:
Sample 1: Application ID
Throughput (mbps)
23.177
23.177
23.177
Sum
69.531 mbps
Channel
Throughput (Mbps)
1
2
3
Bandwidth(MHz)
20
15
10
69.533
52.117
34.703
Sample Number
Comparison Chart:
To draw these graphs by using Excel Insert Chart option and then select chart type as
Line chart.
80
Throughput (mbps)
70
60
50
40
30
20
10
0
20
15
Channel Bandwidth(MHz)
132
10
22.4 Inference
The LTE solution provides spectrum flexibility with scalable transmission bandwidth
between 1.4 MHz and 20 MHz depending on the available spectrum for flexible radio
planning. The 20 MHz bandwidth can provide up to 150 Mbps downlink user data rate and
75 Mbps uplink peak data rate with 22 MIMO, and 300 Mbps with 44 MIMO.
As the channel bandwidth decreases the number of resource blocks also decreases. If more
resource blocks are available then more number of packets can be transmitted.
133
134
8. The S-eNB starts forwarding the downlink data packets to the T-eNB for all the data
bearers (which are being established in the T-eNB during the HANDOVER REQ
message processing).
9. In the meantime, the UE tries to access the T-eNB cell using the non-contention-based
Random Access Procedure. If it succeeds in accessing the target cell, it sends the RRC
CONNECTION RECONFIGURATION COMPLETE to the T-eNB.
10. The T-eNB now requests the S-eNB to release the resources. With this, the handover
procedure is complete.
23.3 Procedure
How to Create Scenario & Generate Traffic in NetSim:
Step 1: Go to Simulation -> New -> LTE/LTE-A
135
Step 2: Click & drop 2 eNBs, 1 MME and 4 UEs onto the Simulation Environment.
Connect the 2 eNBs with MME using Wired Link.
Right click on UE and select Properties. Change the Velocity to 100m/s in Global Properties
for all UEs
Application Type
CUSTOM
Source ID
Destination ID
Step 4:
Click on Run Simulation icon and set simulation time = 100s.
23.4 Output
Open Packet Animation:
Due to Mobility UEs can move from one cell to another. In the below figure, users can see
the handover packet flow in packet animation table.
Users can see the Handover messages in red box present in the above image
As shown in the above packet animation table, UE E, UE D connected to eNB A and
UE F, UE G connected to eNB B
UE F is moving from eNB B to eNB A due to mobility
137
eNB
checks
for
resource
availability
and
sends
23.5 Inference
Firstly UE F is communicating with eNB B. Due to mobility UE F moves from one cell to
another. So Handover occurs. Now UE F starts communicating with eNB A.
138
actuators,
and
network
connectivity that enable these objects to collect and exchange data. An IoT network allows
objects to be sensed and/or controlled remotely across existing network infrastructure,
creating opportunities for more direct integration of the physical world into computer-based
systems, and resulting in improved efficiency, accuracy and economic benefit.
24.1.1
24.1.2
Components
1. Sensors
Sensors are used to detect physical phenomena such as light, heat, pressure, temperature,
humidity etc. Sensors are regarded as a revolutionary information gathering method to build
the information and communication system which will greatly improve the reliability and
efficiency of infrastructure systems. It follows IPv6 addressing system. IP addresses are
139
the backbone to the entire IoT ecosystem. IPv6s huge increase in address space is an
important factor in the development of the Internet of Things.
2. LowPAN Gateway
These are the Gateways to Internet for all the things/devices that we want to interact with.
Gateway help to bridge the internal network of sensor nodes with the external Internet i.e., it
will collect the data from sensors and transmitting it to the internet infrastructure.
A 6LowPAN Gateway will have 2 interfaces, one is Zigbee interface connected to sensors
(follows 802.15.4 MAC and PHY) and the other is WAN interface connected to ROUTER.
140
Step 2: Click and drop 4 sensors, 1 LowPAN Gateway, 1 router and 1 wired node. Connect
Router, LowPAN Gateway and wired node using wired links
Packet
Step 3:
Application Properties:
To add application, drop the Application icon. Edit the Application properties as given in
table. All other properties are default.
Application Type
Sensor_App
Source ID
Destination ID
141
Step 4:
Click on Run Simulation icon and set simulation time = 100s
24.3 Output
At the end of simulation, NetSim provides various performance metrics such as Network
Metrics, Link Metrics, Application Metrics, and Protocol Metrics etc.
In Packet Animation Table, users can see the packet flow.
142
3. Open the NetSim.sln file inside the Simulation folder, it displays a message One or
more projects in the solution were not loaded completely
4. Click on OK and when this opens in MS Visual Studio 2010, it would look like
5. Open IP project
Code Modifications to print ip addresses:
6. Add
the
following
lines
of
code
in
NETWORK_OUT_EVENT
and
if(packet->nPacketType != PacketType_Control)
{
IP_TO_STR(packet->pstruNetworkData->szSourceIP,s_ip);
IP_TO_STR(packet->pstruNetworkData->szDestIP,d_ip);
IP_TO_STR(packet->pstruNetworkData->szGatewayIP,t_ip);
IP_TO_STR(packet->pstruNetworkData->szNextHopIp,r_ip);
if(!fp_ip)
{
fp_ip=fopen("ip.csv", "w");
143
fprintf(fp_ip,
"Packet_Id,Device_Id,Interface_id,Source_IP,Destination_IP,Transmit
ter_IP,Receiver_IP\n");
}
fprintf(fp_ip,"%lld,%d,%d,%s,%s,%s,%s\n",packet>nPacketId,
pstruEventDetails->nDeviceId,pstruEventDetails>nInterfaceId, s_ip, d_ip, t_ip, r_ip);
fflush(fp_ip);
}
In NETWORK_OUT_EVENT
144
In NETWORK_IN_EVENT
145
146
17. Users can understand how the IP addresses are changing from IPv6 to IPv4 and vice
versa with the help of ip.csv file.
18. Sensor and LoWPAN gateways 1st interface follows IPv6 addressing.
19. LoWPAN gateways 2nd interface, Router, Wired Node follows IPv4 addressing.
20. As shown in the above image, users can identify the changing of IP addresses from
source to destination.
147