Netsim Experiment Manual - 1
Netsim Experiment Manual - 1
Netsim Experiment Manual - 1
Experiment Manual
-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 7.1.7, July 2014, 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: sales@tetcos.com
Visit: www.tetcos.com
-2-
List of Experiments
Simulation Experiments
Introduction
1. Introduce students to network simulation through the NetSim simulation package,
Create a simple network model with multiple scenarios, collect statistics on
network performance through the use of NetSim tools, analyze statistics and draw
conclusions on network performance
..Page (7)
Internetworks
2. To understand IP forwarding within a LAN and across a router (Note: NetSim
Standard Version is required to run this experiment)
..Page (12)
3. Study the working of the spanning tree algorithm by varying the priority among
the switches
..Page (18)
TCP
4. To understand the working of Connection Establishment in TCP using NetSim
(Note: NetSim Standard Version is required to run this experiment)
..Page (23)
5. During client-server TCP downloads study the throughputs of Slow start +
Congestion avoidance (also known as Old Tahoe) and Fast Retransmit (also
known as Tahoe), Congestion Control Algorithms
..Page (28)
WLAN
6. To study how the Bit Error Rate (loss) and data of a Wireless LAN (IEEE
802.11b) network varies as the distance between the Access Point and the wireless
nodes is varied
..Page (36)
Routing
7. Study the working and routing table formation of Interior Routing Protocols, i.e.
Routing Information protocol (RIP) and Open Shortest Path First (OSPF)
..Page (41)
-3-
Queuing Theory
8. M/D/1 Queue:
I. To create an M/D/1 queue: a source to generate packets, a queue to act as
the buffer and server, a sink to dispose of serviced packets
II. To study how the delay of such a queuing system varies
..Page (51)
Legacy Networks
9. Study the throughput characteristics of a slotted aloha network
..Page (57)
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
..Page (62)
..Page (66)
ATM
12. Study the effect of Peak Cell Rate (per Sec) and Cell Delay Variation Tolerance
on the performance of an ATM Networks
..Page (70)
13. Study the performance of FIFO, round Robin and Priority queuing techniques in
an ATM network
..Page (75)
BGP Networks
14. Study the working of BGP and formation of BGP Routing table
..Page (86)
MPLS Networks
15. Study how the LSP varies for different traffic in MPLS -TE (Traffic Engineering)
..Page (92)
-4-
Cellular Networks
GSM
16. Study how call blocking probability varies as the load on a GSM network is
continuously increased
..Page (98)
CDMA
17. Study how the number of channels increases and the Call blocking probability
decreases as the Voice activity factor of a CDMA network is decreased
.....Page (102)
Wireless Sensor Networks
18. Study the Super Frame Structure and analyze the effect of SuperFrame order on
throughput
..Page (107)
..Page (112)
Programming Exercises:
Write a C program for the following exercises and link your code to NetSim
How to De-bug your code linked to NetSims Programming Exercise
..Page (117)
Framing Sequence
20. Bit Stuffing and character stuffing
..Page (119)
..Page (128)
-5-
Cryptography
22. Encryption and Decryption using substitution ciphers
..Page (134)
Switching
23. Minimum Spanning Tree algorithm
..Page (138)
..Page (142)
..Page (147)
..Page (150)
..Page (153)
..Page (156)
..Page (160)
-6-
Experiment 1
Objective: Introduce students to network simulation through the NetSim simulation
package. Create a simple network model with multiple scenarios, collect statistics on
network performance through the use of NetSim tools and analyze statistics and draw
conclusions on network performance.
Part A:
Introduce students to network simulation through the NetSim simulation package.
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?
What is simulation?
-7-
-8-
Part B:
Create a Simple network model with multiple scenarios. Collect statistics on network
performance through the use of NetSim. Analyze statistics and draw conclusion on
network performance.
Theory:
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 and
drop the
node
Click and
drop the
hub
Click here
to enable
the trace
Click here
to simulate
Right click
on node to
set
properties
-9-
Delay= queuing delay (ms) + transmission time (ms) + medium access time (ms).
Where queuing delay is the time the packet/frame waits in the queue prior to
transmission, transmission time is the time taken by a packet/frame to travel across
one hop, and medium access time is the time the data waits in the head of the queue to
access the medium.
Click to export
the values to
excel sheet
Metrics
Click to view
the network
Click to edit
and re-run
- 10 -
Click on
protocols to
select the
experiments
Click to
select the
metrics
Plot the chart
here
- 11 -
Experiment 2
Objective:
To understand IP forwarding within a LAN and across a router
Note: NetSim Standard Version is required to run this experiment
Introduction:
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.
Step2:
Click & drop Wired Nodes, Switches and Router onto the Simulation Environment as
shown below.
- 12 -
Step3:
Create the Samples as follows,
Sample Inputs:
Sample 1:
Set the Wired Node Properties as follows,
Node Properties
Wired Node 1
Transmission
Point to Point
Type
Destination
Wired Node 2
Traffic Type
Custom
Distribution
Constant
1460
Packet Inter
Distribution
Constant
Arrival Time
Packet Inter
20000
Packet Size
Disable
- 13 -
Click Packet Trace icon in the tool bar. This is used to log the packet details.
Give a file name and select file type as .csv. Then, 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.
Analysis:Intra-LAN-IP-forwarding:
ARP REQUEST
Source
ARP Response
Destination
Switch
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 NODE-1 to NODE-2. Notice the DESTINATION_ID column for ARP_Request
type packets.
NetSim Experiment Manual
- 14 -
Sample 2:
Set the Wired Node Properties as follows,
Node Properties
Wired Node 1
Transmission Type
Point to Point
Destination
Wired Node3
Traffic Type
Custom
Distribution
Constant
1460
Packet Inter
Distribution
Constant
Arrival Time
Packet Inter
20000
Packet Size
Disable
Click Packet Trace icon in the tool bar. This is used to log the packet details.
Give a file name and select file type as .csv. Then, 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.
- 15 -
Analysis:Across-Router-IP-forwarding:
STEP-1
STEP-2
ARP request for
Default Gateways
MAC address
Source
Default Gateway
Data Packet
Default Gateway
Source
ARP response for
Default Gateways
MAC address
ARP
Response
Data
Packet
Source
A Brief Explanation:
NODE-1 transmits ARP_Request which is further broadcasted by SWITCH-4. ROUTER6 sends ARP_Reply to NODE-1 which goes through SWITCH-4. Then NODE-1 starts to
send data to NODE-3.
NetSim Experiment Manual
- 16 -
If the router has the address of NODE-3 in its routing table, ARP protocol ends here and
data transfer starts that is PACKET_ID 1 being sent from NODE-1 to NODE-3. In other
case, Router sends ARP_Request to appropriate subnet and after getting the MAC
ADDRESS of the NODE-3, it forwards the packet which it has received from NODE-1.
PART 2: - Changing default Gateway
Do Sample 2 in PART 1 with the difference that in the properties of NODE-1, change
the default gateway to some other value, for ex. 192.168.2.76 and click on Simulate
button.
You will get error. Because NODE-1 will check the IP address of NODE-3 and then
realize that it isnt in the same subnet. So it will forward it to default gateway. Since the
default gateways address doesnt exist in the network, error occurs.
Inference:
When a node has to send data to a node with known IP address but unknown MAC
address, it sends an ARP request. If destination is in same subnet as the source (found
through subnet mask) then it sends the ARP (broadcast ARP message) request. Otherwise it
forwards it to default gateway. Former case happens in case of intra-LAN
communication. The destination node sends an ARP response which is then forwarded by
the switch to the initial node. Then data transmission starts.
In latter case, a totally different approach is followed. Source sends the ARP request to
the default gateway and gets back the MAC address of default gateway. (If it knows
which router to send then it sends ARP request to the corresponding router and not to
Default gateway) When source sends data to default gateway (a router in this case), the
router broadcasts ARP request for the destined IP address in the appropriate subnet. On
getting the ARP response from destination, router then sends the data packet to
destination node.
- 17 -
Experiment 3
Objective:
Study the working of the spanning tree algorithm by varying the priority among the
switches.
Theory:
Refer NetSim Basics on Spanning Tree.
Procedure:
How to Create Scenario & Generate Traffic:
Please navigate through the below given path to,
(Note: Minimum three switches are needed in the simulation to study about spanning tree
formation.)
- 18 -
Sample Inputs:
Inputs for the Sample experiments are given below,
Sample 1:
Node
Wired Node 1
Wired Node 2
Point to Point
Point to Point
Destination
Wired Node2
Wired Node1
Traffic Type
Custom
Custom
Properties
Transmission
Type
Packet Size
Distribution
Constant
Distribution
Constant
Packet Size
1460
Packet Size
1460
(bytes)
(bytes)
Packet Inter
Distribution
Constant
Distribution
Constant
Arrival Time
Packet Inter
20000
Packet Inter
20000
Arrival Time
Arrival Time
(s)
(s)
(Note: Wired Node 3 is not generating Traffic to any other Wired Nodes)
Switch
Properties
FE_LAN_8_
FE_LAN_8_
FE_LAN_8_
Switch
Priority
(Note: Switch Priority for all the ports of Switch has to be same and all other properties of
Switch is default)
- 19 -
Sample 2:
Node
Wired Node 1
Wired Node 2
Point to Point
Point to Point
Destination
Wired Node2
Wired Node1
Traffic Type
Custom
Custom
Properties
Transmission
Type
Packet Size
Distribution
Constant
Distribution
Constant
Packet Size
1460
Packet Size
1460
(bytes)
(bytes)
Packet Inter
Distribution
Constant
Distribution
Constant
Arrival Time
Packet Inter
20000
Packet Inter
20000
Arrival
Arrival
Time (s)
Time (s)
(Note: Wired Node 3 is not generating Traffic to any other Wired Nodes)
Switch
FE_LAN_8_
FE_LAN_8_
Properties
Port Switch 1
Switch
FE_LAN_8_
Priority
(Note: Switch Priority for all the ports of Switch has to be same and all other properties of
Switch is default)
- 20 -
Output:
To view the output, click the View Spanning Tree Link available on the Performance
Metrics screen under Resources.
Sample 1:
Sample 2:
- 21 -
Inference:
In the Sample 1, FE_ LAN _8 Port_Switch 2 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 Node1 should take the path through the FE_
LAN _8 Port_Switch 2 to reach the Wired Node2.
In the Sample 2, FE_ LAN _8 Port_Switch 1 was assigned least priority and selected as a
Root switch. In this case, the frame from Wired Node1 can directly reach the destination
Wired Node2.
- 22 -
Experiment 4
Objective:
To understand the working of Connection Establishment in TCP using NetSim.
Note: NetSim Standard Version is required to run this Experiment.
Introduction:
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 threeway 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
2. SYN-SENT
<A: SEQ=100><CTL=SYN>
SYN-RECEIVED
SYN-RECEIVED
ESTABLISHED
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
- 23 -
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.
Simulation:
How to Create Scenario & Generate Traffic:
Step1:
Simulation New Internetworks
Step2:
Click & drop Wired Nodes and Router onto the Simulation Environment as shown below.
- 24 -
Step3:
Set the properties of the WiredNode1 as follows:
Values
Transmission Type
Point to point
Destination
Traffic Type
FTP
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
By clicking on simulate we will get the following results:
- 25 -
Go to the specified directory where the packet trace file has been saved.
- 26 -
packet that has been received from NODE-1 to the NODE-2. In line 7, 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 8, ROUTER-3 is sending the TCP_SYN_ACK, (received from
NODE-2) to the NODE-1. In line 9, 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 DATA is sent
from the NODE-1 to the NODE-2 in line 10.
Example Assessment Question:
Explain the working of Closing a connection in TCP using the NetSims packet
trace.
- 27 -
Experiment 5
Objective:
During client-server TCP downloads study the throughputs of Slow start + Congestion
avoidance (also known as Old Tahoe) and Fast Retransmit (also known as Tahoe),
Congestion Control Algorithms.
Theory:
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.
- 28 -
- 29 -
Procedure:
How to Create Scenario
Help NetSim Help F1 Running Simulation via GUI Internetworks Create
Scenario.
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,
Node Properties
Wired Node 2
Destination
Wired Node 1
Traffic Type
Custom
Packet Size
Distribution
Constant
1460
Constant
1300
TCP Properties
MSS(bytes)
1460
Old Tahoe
- 30 -
Link Properties
Link 1
Link 2
Link 3
Medium Type
E2
CAT5
E2
8.448
10
8.448
Downlink Speed(Mbps)
8.448
10
8.448
Uplink BER
10-6
10-6
10-6
Downlink BER
10-6
10-6
10-6
Wired Node 1 and Wired Node 2 are connected with Router 1 by Link 1 and Link 2.
Wired Node 3 and Wired Node 4 are connected with Router 2 by Link 4 and Link 5.
Wired Node 1 and Wired Node 2 are not transmitting data in this sample.
- 31 -
Node Properties
Wired Node 3
Wired Node 4
Destination
Wired Node 1
Wired Node 2
Traffic Type
Custom
Custom
Packet Size
Distribution
Constant
Constant
1460
1460
Constant
Constant
1300
1300
TCP Properties
MSS(bytes)
1460
1460
Old Tahoe
Old Tahoe
Link 1
Link 2
Link 3
Link 4
Link 5
Medium Type
E2
E2
CAT5
E2
E2
8.448
8.448
10
8.448
8.448
8.448
10
8.448
8.448
Uplink BER
10-6
10-6
10-6
10-6
10-6
Downlink BER
10-6
10-6
10-6
10-6
10-6
- 32 -
Nodes 1, Node 2 & Node 3 are connected with Router 1 by Link 1, Link 2 & Link 3.
Nodes 4, Node 5 & Node 6 are connected with Router 2 by Link 5, Link 6 & Link 7.
Node 1, Node 2 and Node 3 are not transmitting data in this sample.
Wired Node 4
Wired Node 5
Wired Node 6
Destination
Wired Node 1
Wired Node 2
Wired Node 3
Traffic Type
Custom
Custom
Custom
Packet Size
Distribution
Constant
Constant
Constant
1460
1460
1460
Constant
Constant
Constant
Packet Inter
Arrival Time (s)
1300
1300
1300
TCP Properties
MSS(bytes)
1460
1460
1460
Old Tahoe
Old Tahoe
- 33 -
Link
Properties
Link 1
Link 2 Link 3
Link 4
Link 5
Link 6 Link 7
Medium Type
E2
E2
E2
CAT5
E2
E2
E2
Uplink Speed
(Mbps)
8.448
8.448
8.448
10
8.448
8.448
8.448
Downlink
Speed(Mbps)
8.448
8.448
8.448
10
8.448
8.448
8.448
Uplink BER
10-6
10-6
10-6
10-6
10-6
10-6
10-6
Downlink BER
10-6
10-6
10-6
10-6
10-6
10-6
10-6
- 34 -
Comparison Table:
TCP
Downloads
Metrics
Slow start +
Congestion
avoidance
Fast
Retransmit
Throughput(Mbps)
6.46
7.04
Segments Retransmitted +
191
Seg Fast Retransmitted
229
8.86
9.43
Segments Retransmitted +
266
Seg Fast Retransmitted
253
Throughput(Mbps)
9.24
9.41
315
Note: To calculate the Throughput(Mbps) for more than one client, add the individual
client 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.
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.
- 35 -
Experiment 6
Objective:
To study how the Bit Error Rate (loss) and data of a Wireless LAN (IEEE 802.11b)
network varies as the distance between the Access Point and the wireless nodes is varied.
Theory:
Please navigate through the below given path to,
Basics Internetworks Wireless LAN IEEE 802.11 PHY.
In most of the WLAN products on the market based on the IEEE 802.11b technology the
transmitter is designed as a Direct Sequence Spread Spectrum Phase Shift Keying (DSSS
PSK) modulator, which is capable of handling data rates of up to 11 Mbps. The system
implements various modulation modes for every transmission rate, which are Different
Binary Phase Shift Keying (DPSK) for 1 Mbps, Different Quaternary Phase Shift Keying
(DQPSK) for 2 Mbps and Complementary Code Keying (CCK) for 5.5 Mbps and 11
Mbps.
Large Scale Fading represents Receiver Signal Strength or path loss over a large area as a
function of distance. The statistics of large scale fading provides a way of computing
estimated signal power or path loss as a function of distance and modulation modes vary
depends on the Receiver Signal Strength.
Procedure:
How to Create Scenario & Generate Traffic:
Please navigate through the below given path to,
Create Scenario: Help NetSim Help F1 Running Simulation via GUI
Internetworks Create Scenario.
Sample Inputs:
In this Sample experiment, 1 Wireless AP and 2 Wireless Nodes (WirelessNode1 and
WirelessNode2) need to be click & dropped onto the Simulation environment. Connect
the AP and the Nodes. Set the below properties for AP, Wireless Nodes and Wireless
Link. Run the simulation. Upon completion of the experiment Save them for
comparisons that can be carried out in the Analytics section by using export to Excel
NetSim Experiment Manual
- 36 -
Then follow these steps, Wireless Node 1 transmits data to Wireless Node 2
AP 1
Protocol
IEEE802.11b
Buffer Size(MB)
RTS Threshold(bytes)
2347
Retry Limit
Transmission Type
DSSS
Standard Channel
1_2412
100
SIFS
10
Slot Time
20
CW Minimum
31
Node 1
Transmission
Point to Point
Destination
Node2
Traffic Type
Custom
Distribution
Data Size
Constant
(bytes)
1375
Distribution
Constant
1000
- 37 -
Time (s)
ARP Retry Interval
10
Protocol
IEEE802.11b
RTS Threshold(bytes)
2347
Retry Limit
Transmission
DSSS
Standard Channel
1_2412
100
SIFS
10
Slot Time
20
CW Minimum
31
Link Properties
Link 1
Medium Type
WIRELESS
11
2412
3.5
Fading Figure
1.0
Log Normal
Shadowing-Standard
Deviation(dB)
Set the properties for the Wireless Nodes, AP and Wireless Link.
- 38 -
Output:
To view the output by using NetSim the Sample experiments need to be added onto the
Analytics interface. The navigation for analytics is -Simulation Analytics
Select the experiments by selecting
Internetworks
Comparison Chart:
To draw these graphs by using Excel Insert Chart option and then select chart type as
Line chart.
Graph I
Graph II
11 Mbps
5.5 Mbps
2 Mbps
1 Mbps
- 39 -
Graph I
Sl.
No
Approx
Range (m)
Data Rate
1.
1 17*
11
CCK11
Exponential Increases.
2.
17 24*
5.5
CCK5.5
3.
24 - 40*
DQPSK
4.
40 70*
DBPSK
(Mbps)
*** All the above plots highly depend upon the placement of Node 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.
Graph II
The data rate between the Access Point and the wireless nodes decreases. This is because
data rate dependents on the received power at the receiver. Received power is directly
proportional to (1 / distance).
- 40 -
Experiment 7
Objective: Study the working and routing table formation of Interior routing protocols,
i.e. Routing Information Protocol (RIP) and Open Shortest Path First (OSPF).
Theory:
RIP
RIP is intended to allow hosts and gateways to exchange information for computing
routes through an IP-based network. RIP is a distance vector protocol which is based on
Bellman-Ford algorithm. This algorithm has been used for routing computation in the
network.
Distance vector algorithms are based on the exchange of only a small amount of
information using RIP messages.
Each entity (router or host) that participates in the routing protocol is assumed to keep
information about all of the destinations within the system. Generally, information about
all entities connected to one network is summarized by a single entry, which describes the
route to all destinations on that network. This summarization is possible because as far as
IP is concerned, routing within a network is invisible. Each entry in this routing database
includes the next router to which datagrams destined for the entity should be sent. In
addition, it includes a "metric" measuring the total distance to the entity.
Distance is a somewhat generalized concept, which may cover the time delay in getting
messages to the entity, the dollar cost of sending messages to it, etc. Distance vector
algorithms get their name from the fact that it is possible to compute optimal routes when
the only information exchanged is the list of these distances. Furthermore, information is
only exchanged among entities that are adjacent, that is, entities that share a common
network.
OSPF
In OSPF, the Packets are transmitted through the shortest path between the source and
destination.
- 41 -
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
loop-free 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
- 42 -
Simulation:
How to Create Scenario & Generate Traffic:
Sample 1:
Step1:
Simulation New Internetworks
Step2:
Click & drop Routers, Switches and Nodes onto the Simulation Environment as shown
- 43 -
Step3:
Set the properties of the WiredNode1 as follows:
- 44 -
Sample 2:
To model a scenario follows the same steps given in Sample1 and
Set the Router properties as given below
Link Properties:
Link Properties
Link 3
Medium Type
CAT - 5
Uplink Speed
Downlink Speed
Link 4
Link 5
Link 6
Link 7
CAT 5
CAT - 5
CAT - 5
CAT - 5
100
100
100
10
10
100
100
100
10
10
- 45 -
Inference:
RIP
In Distance vector routing, each router periodically shares its knowledge about the entire
network with its neighbors. The three keys to understanding the algorithm,
1. Knowledge about the whole network
Router sends all of its collected knowledge about the network to its neighbors
2. Routing only to neighbors
Each router periodically sends its knowledge about the network only to those routers
to which it has direct links. It sends whatever knowledge it has about the whole
network through all of its ports. This information is received and kept by each
neighboring router and used to update that routers own information about the
network.
3. Information sharing at regular intervals
For example, every 30 seconds, each router sends its information about the whole
network to its neighbors. This sharing occurs whether or not the network has changed
since the last time information was exchanged
In NetSim the Routing table Formation has 3 stages
Initial Table: This table will show the direct connections made by each Router.
Intermediate Table: The Intermediate table will have the updates of the Network in every
30 seconds
Final Table: This table is formed when there is no update in the Network.
The data should be forwarded using Routing Table with the shortest distance
The RIP table in NetSim
After running sample1, click RIP table in Performance Metrics screen. Then click the
router to view the Routing table.
- 46 -
- 47 -
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 OSPFcalculated cost, not a hop count.
The OSPF table in NetSim
After running sample2, click OSPF Metrics in Performance Metrics screen. Then
click the router to view the Routing table
- 48 -
- 49 -
- 50 -
Experiment 8
Objective:
M/D/1 Queue:
I.
II.
Theory:
In systems where the service time is a constant, the M/D/1, single-server queue model,
can be used. Following Kendall's notation it indicates a system where:
Where = Service Rate = 1/Service time and is the utilization given as follows,
- 51 -
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.
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
Node Properties
Wired Node 1
Destination
Wired Node 2
Traffic Type
Custom
1250
Constant
2000
Exponential
- 52 -
Link Properties
Link 1
Link 2
Medium Type
CAT-5
CAT-5
10
10
10
10
Uplink BER
No Error
No Error
Downlink BER
No Error
No Error
Delay 0
Downlink
Propagation
(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
MAC layer
26
Physical Layer
Total
54
- 53 -
Theoretical Calculation:
By formula,
= Service Rate
Service rate is nothing but the time taken to service each packet and is given by
Service rate = Link capacity (bps) / (Payload Size (Bytes) * 8)
= (10106) / (1304*8)
= 958.59 packets / sec
= Arrival rate
Arrival rate the rate at which packets arrive (Packets per second)
Inter-arrival time = 2,000 micro sec
Arrival rate = 1,000,000 / Inter Arrival time
= 1,000,000/2000
= 500 packets / sec
= Utilization
= /
= 500/958.59
= 0.522
By formula, Queuing Time =
= 569.61 micro sec
- 54 -
Output:
After running the simulation, check the Mean Delay in the Application Metrics.
Mean Delay = 2671.333 micro sec
This 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 = 2671.333 (2 1043.2) 1
= 583.933 micro sec
Note: Obtained value is slightly higher than the theoretical value because of initial delays
in forming ARP table, Switch table and Routing table etc.
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
NetSim Experiment Manual
- 55 -
- 56 -
Experiment 9
Objective: Plot the characteristic curve throughput versus offered traffic for a Slotted
ALOHA system.
(Reference: Computer Networks, 3rd Edition. Andrew S. Tanenbaum)
Theory:
ALOHA provides a wireless data network. It is a multiple access protocol (this protocol is
for allocating a multiple access channel). There are two main versions of ALOHA: pure
and slotted. They differ with respect to whether or not time is divided up into discrete
slots into which all frames must fit.
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
Where, S (frames per 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
an slot is 0.368
Calculations used in NetSim to obtain the plot between S and G:
Using NetSim, the attempts per packet time (G) can be calculated as follows;
Where,
G =
TA =
Total Attempt
PT =
ST =
- 57 -
Where,
PT =
PS =
Create Scenario: Help NetSim Help Running Simulation via GUI Legacy
Networks Create Scenario.
Obtain the values of Throughput and Total Attempts from the statistics of NetSim
simulation for various numbers of traffic generators.
Sample Inputs:
Input for Sample 1: Node 1 transmits data to Node 2.
Node Properties
NODE 1
Transmission
Point-to-Point
Destination
Node-2
Traffic Type
Data
Application Data Size
Distribution
Constant
1472
Constant
20000
- 58 -
(Note: The Simulation Time can be selected only after doing the following two tasks,
Input for Sample 2: Node 1 transmits data to Node 2, Node 2 transmits data to Node 1.
Node Properties
NODE 1
NODE 2
Transmission
Point-to-Point
Point-to-Point
Destination
Node-2
Node-1
Traffic Type
Data
Data
Constant
Constant
1472
1472
Constant
Constant
20000
20000
- 59 -
Comparison Table:
Number of
nodes
generating
traffic
Throughput
(mbps)
Total
attempts
Throughput
per packet time
Attempts per
packet time
0.59
499
0.06
0.06
1.2
3308
0.12
0.39
1.8
4953
0.18
0.59
2.4
6691
0.24
0.80
2.9
9180
0.29
1.09
2.8
14012
0.28
1.67
2.7
14868
0.27
1.78
10
2.7
15078
0.27
1.80
15
2.6
16037
0.26
1.92
20
2.5
16437
0.25
1.96
22
2.4
16496
0.24
1.97
24
2.4
16755
0.24
2.00
We have obtained the following characteristic plot for the Slotted ALOHA, which
matches the theoretical result.
- 60 -
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.
- 61 -
Experiment 10
Objective:
Understand the impact of bit error rate on packet error and investigate the impact of error
of a simple hub based CSMA / CD network
Theory:
Bit error rate (BER): The bit error rate or bit error ratio is the number of bit errors
divided by the total number of transferred bits during a studied time interval i.e.
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.
Packet Error Rate (PER):
The PER is the number of incorrectly received data packets divided by the total number
of received packets. A packet is declared incorrect if at least one bit is erroneous. The
expectation of the PER is denoted as packet error probability pp , which for a data packet
length of N bits can be expressed as,
It is based on the assumption that the bit errors are independent of each other.
Derivation of the packet error probability:
Suppose packet size is N bits.
is the bit error probability then probability of no bit error=1As packet size is N bits and it is the assumption that the bit errors are independent. Hence,
Probability of a packet with no errors =
A packet is erroneous if at least there is one bit error, hence
NetSim Experiment Manual
- 62 -
Procedure:
How to create a scenario and generate traffic:
Create Scenario: Help NetSim Help Running Simulation via GUI NonInternetworks Legacy Networks Create Scenario.
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:
In this sample experiment, two nodes and one hub are clicked and dropped on the
environment builder. And following experiments are performed.
Inputs for the sample experiments are given below,
Node Properties
Node1
Transmission Type
Point to Point
Destination
Node 2
1472
Distribution
Constant
2500
MTU Size(bytes)
1500
Hub 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
Physical Medium
Twisted
Twisted
Twisted
Twisted
Twisted Pair
Pair
Pair
Pair
Pair
- 63 -
Example 2:
Sample Inputs:
In this sample experiment, four nodes and one hub are clicked and dropped on the
environment builder. And following experiments are performed.
Inputs for the sample experiments are given below,
Node Properties
Node1
Node3
Transmission Type
Point to Point
Point to Point
Destination
Node 2
Node4
1472
1472
Distribution
Constant
Constant
2500
2500
MTU Size(bytes)
1500
1500
Hub 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
Physical Medium
Twisted
Twisted
Twisted
Twisted
Twisted
Pair
Pair
Pair
Pair
Pair
- 64 -
Packets
Errored
0
1E-09
1E-08
1E-07
1E-06
Total
packets
0
1
2
49
472
40000
40000
40000
40000
40000
Packets
Errored
Total
packets
0
1
9
96
921
80000
80000
80000
80000
80000
Packet size for the calculation of the output table=1500 bytes or 12000 bits
Comparing Packets errored with Bit error rate:
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.
- 65 -
Experiment 11
Objective:
To determine the optimum persistence of a p-persistent CSMA / CD network for a
heavily loaded bus capacity.
Theory:
Carrier Sense Multiple Access Collision Detection (CSMA / CD)
This protocol includes the improvements for stations to abort their transmissions as soon
as they detect a collision. Quickly terminating damaged frames saves time and bandwidth.
This protocol is widely used on LANs in the MAC sub layer. If two or more stations
decide to transmit simultaneously, there will be a collision. Collisions can be detected by
looking at the power or pulse width of the received signal and comparing it to the
transmitted signal. After a station detects a collision, it aborts its transmission, waits a
random period of time and then tries again, assuming that no other station has started
transmitting in the meantime.
There are mainly three theoretical versions of the CSMA /CD protocol:
1-persistent CSMA / CD: When a station has data to send, it first listens to the channel
to see if anyone else is transmitting at that moment. If the channel is busy, the station
waits until it becomes idle. When station detects an idle channel, it transmits a frame. If a
collision occurs, the station waits a random amount of time and starts all over again. The
protocol is called 1-persistent because the station transmits with a probability of 1
whenever it finds the channel idle.
Ethernet, which is used in real-life, uses 1-persistence. A consequence of 1-persistence is
that, if more than one station is waiting for the channel to get idle, and when the channel
gets idle, a collision is certain. Ethernet then handles the resulting collision via the usual
exponential back off. If N stations are waiting to transmit, the time required for one
station to win the back off is linear in N.
Non-persistent CSMA /CD: In this protocol, before sending, a station senses the
channel. If no one else is sending, the station begins doing so itself. However, if the
channel is already in use, the channel does not continually sense it for the purpose of
seizing it immediately upon detecting the end of the previous transmission. Instead, it
waits a random period of time and then repeats the algorithm. Intuitively this algorithm
should lead to better channel utilization and longer delays than 1-persistent CSMA
- 66 -
p-persistent CSMA / CD: This protocol applies to slotted channels. 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 collided with the newly arriving packets.
Procedure:
How to create a scenario and generate traffic:
Create Scenario: Help NetSim Help Running Simulation via GUI Legacy
Networks Create Scenario.
Scenario:
- 67 -
Sample Input:
In this Sample experiment 12 Nodes and 2 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
Transmission Type
Broadcast
Traffic Type
Data
MTU Size(bytes)
1500
Vary persistence from 1/2, 1/3, 1/4, 1/5 1/12, to generate other experiments.
Data Input Configuration: (This window is obtained when Data is selected in Traffic
Type):
Packet Size
Distribution
Constant
1472
Distribution
Exponential
1000
Hub Properties
Values to be
Selected
Data Rate(Mbps)
10
Twisted Pair
- 68 -
(Note: The Simulation Time can be selected only after the following two tasks,
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:
Optimum
Inference:
As the number of logged in users is quite large in this experiment, the performance of a
p-persistent 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/11.
- 69 -
Experiment 12
Objective
Study the effect of Peak Cell Rate (per Sec) and Cell Delay Variation Tolerance on the
performance of an ATM Networks
Procedure:
How to Create Scenario & Generate Traffic:
Please navigate through the below given path to,
Create Scenario: Help NetSim Help Running Simulation via GUI Legacy
Networks Create Scenario.
Inputs
Follow the steps given in the different samples to arrive at the objective.
In this Sample,
CPE 1, CPE 2 is connected with Switch 1 and Switch 2 by Link 1 and Link 3
respectively.
Set the properties of Switch and CPE by following the tables for each sample,
Switch Properties
Switch 1
Switch 2
Scheduling Technique
Priority
Priority
Link Properties
Link 1
Link 2
Link 3
No Error
No Error
No Error
Physical Medium
E0
E0
E0
Distance (km)
- 70 -
CPE 1
Destination
CPE 2
Transmission Type
Point to Point
Traffic Type
Data
Application Data Size
Distribution
Exponential
1500
Exponential
20000
1000
1000
(s)
CPE Properties
CPE 1
Destination
CPE 2
Transmission Type
Point to Point
Traffic Type
Data
Application Data Size
Distribution
Exponential
1500
Exponential
20000
2000
2000
(s)
- 71 -
CPE Properties
CPE 1
Destination
CPE 2
Transmission Type
Point to Point
Traffic Type
Data
Application Data Size
Distribution
Exponential
1500
Exponential
20000
3000
3000
(s)
CPE Properties
CPE 1
Destination
CPE 2
Transmission Type
Point to Point
Traffic Type
Data
Application Data Size
Distribution
Exponential
1500
Exponential
20000
4000
4000
(s)
- 72 -
CPE Properties
CPE 1
Destination
CPE 2
Transmission Type
Point to Point
Traffic Type
Data
Application Data Size
Distribution
Exponential
1500
Exponential
20000
5000
5000
(s)
Output
To view the output by using NetSim Sample experiments need to be added onto the
Analytics interface. Given below is the navigation for analytics Simulation Analytics
Select the experiments by selecting
Legacy Networks
Select the Experiments (Note: Click one experiment after another to compare the
experiments in the Analytics interface).
- 73 -
Comparison Charts:
Inference
To see Peak Cell Rate and Cell Delay Variation Tolerance definitions go to NetSim
Basics Menu.
When the Peak Cell Rate and Cell Delay Variation Tolerance are changed from 1000 to
5000, the Number of Cells transmitted increases. This is because the conformance of the
traffic depends on the Peak Cell Rate and the Cell Delay Variation Tolerance. As the
number of cells transmitted increases, queuing delay also increases.
- 74 -
Experiment 13
Objective
Network performance analysis with an ATM switch implementing different scheduling
techniques like First in First out (FIFO), Priority, and Round Robin
Theory
In an ATM network, scheduling of cells is the major task of any ATM switch. Scheduling
is the process by which the ATM switch determines the sequence of flow of the cells in
network. The scheduling is done on various properties like service type, cell category,
queue length, arrival time etc.
First In First out (FIFO): FIFO is the simplest way of scheduling. As the name
suggests, in this technique, the preference is given to that cell which comes first in the
queue irrespective of its priority value. The one which comes next waits until the first
finishes. The drawback of this technique is that some cells of very high priority like audio
service encounter extra delay that is not ignorable.
Priority: In this technique, each cell is assigned a certain priority value based on its
traffic parameters. The scheduler checks the availability of highest priority cells and
schedules them before going for the lower priority cells. The drawback of this algorithm
is that cells of lowest priority starve for the resources when there are a large number of
higher priority cells.
Round Robin: In this technique, the scheduler gives equal preference for all priority
types. Therefore, scheduler processes one cell of each priority type (If available) before
going for the next cell and cycles through them. Here starvation never occurs because no
priority is given. Round robin scheduling may not be desirable if QoS of the different
priority type are highly variable.
Procedure:
In this experiment, we are going to analyze the link Utilization (%) of the outgoing link
from an ATM switch
NetSim Experiment Manual
- 75 -
Create Scenario: Help NetSim Help Running Simulation via GUI Legacy
Networks Create Scenario.
Inputs
Follow the steps given in the different samples to arrive at the objective.
In all Samples,
Switch Properties
Switch 1
Switch 2
Scheduling technique
FIFO
FIFO
Buffer size
4096 KB
4096 KB
CPE Properties
CPE 1
Destination
CPE 3
Transmission Type
Point to Point
Traffic Type
Data
Application Data Size
Distribution
Constant
10000
- 76 -
Constant
10000
Scheduling
FIFO
99999
99999
GCRA type
VSA
CPE Properties
CPE 2
Destination
CPE 4
Transmission Type
Point to Point
Traffic Type
Voice
Codec
Constant
10000
20000
Service Type
CBR
Scheduling
FIFO
99999
99999
GCRA type
VSA
Link Properties
Link 1
Link 2
Link 3
Link 4
Link 5
No Error
No Error
No Error
No Error
No Error
Physical medium
E2
E2
E0
T1
T1
8.448
8.448
0.064
1.54
1.54
Distance
(BER)
- 77 -
(Note: The Simulation Time can be selected only after doing the following two tasks,
Output:
Select the metrics Utilization and Delay report (Link). Note down the link utilization of
link 4 and link 5.
Priority:
In NetSim, Select SimulationNewLegacy Networks ATM
In the simulation environment window create the following scenario
How to Create Scenario & generate traffic:
Create Scenario: Help NetSim Help Running Simulation via GUI Legacy
Networks Create Scenario.
Inputs:
Follow the steps given in the different samples to arrive at the objective.
In all Samples,
- 78 -
Switch Properties
Switch 1
Switch 2
Scheduling technique
Priority
FIFO
Buffer size
4096 KB
4096 KB
CPE Properties
CPE 1
Destination
CPE 3
Transmission Type
Point to Point
Traffic Type
Data
Application Data Size
Distribution
Constant
10000
Constant
10000
Scheduling
FIFO
99999
99999
GCRA type
VSA
CPE Properties
CPE 2
Destination
CPE 4
Transmission Type
Point to Point
- 79 -
Traffic Type
Voice
Codec
Constant
10000
20000
Service Type
CBR
Scheduling
FIFO
99999
99999
GCRA type
VSA
Link Properties
Link 1
Link 2
Link 3
Link 4
Link 5
No Error
No Error
No Error
No Error
No Error
Physical medium
E2
E2
E0
T1
T1
8.448
8.448
0.064
1.54
1.54
Distance
(BER)
Output:
Select the metrics Utilization and Delay report (Link). Note down the link utilization of
link 4 and link 5.
- 80 -
Round Robin:
In NetSim, Select SimulationNewLegacy Networks ATM
In the simulation environment window create the following scenario
How to Create Scenario & generate traffic:
Create Scenario: Help NetSim Help Running Simulation via GUI Legacy
Networks Create Scenario.
Inputs:
Follow the steps given in the different samples to arrive at the objective.
In all Samples,
- 81 -
Switch Properties
Switch 1
Switch 2
Scheduling technique
Round Robin
FIFO
Buffer size
4096 KB
4096 KB
Link Properties
Bit Error Rate
(BER)
Physical medium
Data Rate (Mbps)
Distance
Link 1
No Error
Link 2
No Error
Link 3
No Error
Link 4
No Error
Link 5
No Error
E2
8.448
1
E2
8.448
1
E0
0.064
1
T1
1.54
1
T1
1.54
1
CPE Properties
CPE 1
Destination
CPE 3
Transmission Type
Point to Point
Traffic Type
Data
Application Data Size
Distribution
Constant
10000
Constant
10000
Scheduling
FIFO
99999
99999
GCRA type
VSA
CPE Properties
CPE 2
Destination
CPE 4
Transmission Type
Point to Point
Traffic Type
Voice
Codec
Constant
10000
20000
- 82 -
Service Type
CBR
Scheduling
FIFO
99999
99999
GCRA type
VSA
Output:
Select the metrics Utilization and Delay report (Link). Note down the link utilization of
link 4 and link 5.
- 83 -
Comparison:
Traffic analysis:
- 84 -
CPE 1 is transmitting Data traffic (being generated at 8 Mbps) to CPE 3 through links 1,
3, and 4. CPE2 transmitting voice traffic (being generated at 4 Mbps) to CPE4 through
link 2, 3, and 5. Here, voice traffic has priority over data traffic.
Link speed of link 1 and 2 is high (8.448 mbps) as compared to data rate and also the
PCR and CDVT of CPE1 and CPE 2 are high. So there is a low probability that these
cells will be dropped. Therefore, all the cells reach switch1 where scheduling will
happens.
Link speed of link 3 is very low (0.064 mbps) which means it does not have enough
resources to handle the cells. Hence, it will only pass those cells that have high priority
(based on Scheduling technique). Link speed of 4 and 5 is high compared to link 3 and so
there is no queue is buildup on switch 2. Based on what type of cells pass through link 3,
determines the utilization of the link 4 and link 5.
Inference:
As we see in chart 1 and table 1, the utilization of link 4 is double of link 5 in case of
FIFO. Because, in case of FIFO, scheduler gives preference to which come cells first.
Note that the data rate of CPE1 id double than CPE2 data rate and link speed is same
hence switch 1 gets two cells from CPE 1 and one cell from CPE2. Hence, switch 1
schedules two packets of CPE1 and one packet of CPE2. Therefore, the number of packet
transmitted through link 4 is double than link 5 and hence utilization is also double.
In case of priority, the utilization of the link 4 is 0.006 % and link 5 is 4.138%. This is
because the ATM scheduler gives priority to the voice traffic (generated by CPE2 to CPE
4 via link 2, 3, and 5) over data traffic (generated by CPE 1 to CPE 3 via link 1, 3 and 4).
The generation rate of voice traffic is 4 mbps which is much greater than the link speed of
link 3 (0.064mbps). Hence, scheduler only schedules voice traffic and data traffic keeps
waiting in the queue.
In case of round robin the utilization of both the links is the same. Because, in case of
Round robin, scheduler schedules the packet in circular fashion means one packet from
CPE1 and one packet from CPE2. Note that the data rate of CPE1 and CPE2 is
sufficiently high to ensure presence of a packet in the buffer from both the CPEs.
Therefore, the number of packets transmitted through link four is same as link five and
hence utilization is also same.
- 85 -
Experiment 14
Objective:
Study the working of BGP and formation of BGP Routing table.
Theory:
In BGP, the Packets are transmitted between the Autonomous system using Path vector
Routing.
Procedure:
How to Create Scenario:
Create Scenario: Help NetSim Help Running Simulation via GUI BGP
Networks Create Scenario.
Sample Inputs:
Follow the steps given in the different samples to arrive at the objective.
CPE 1 and CPE 2 are connected with Internal Router 3 by Link 1 and Link 2.
- 86 -
Internal Router 4 is connected with CPE 3 and CPE 4 by Link 6 and Link 7
respectively.
CPE 1
CPE 2
Destination
CPE 3
CPE 4
Priority
Low
Low
Traffic Type
Data
Data
Constant
Constant
1472
1472
Constant
Constant
20000
20000
If you want to select your internal gateway protocol as RIP then here is the information
you need to fill in for Router properties
Router
Properties
BGP Router1
BGP Router2
Internal Router3
Port 1
Port 2
Port 1
Port 2
Port 1
Port 2
Port 3
Buffer Size
(KB)
Scheduling
Type
Protocol Type
Priority Priority
Priority
Priority
Priority
Priority Priority
RIP
BGP
BGP
RIP
RIP
RIP
RIP
Periodic Time
30
30
30
30
30
Expiration
Time
Garbage
Collection
Time
Local
Preference
MED
180
180
180
180
180
120
120
120
120
120
100
100
- 87 -
Router Properties
Internal Router4
Port 1
Port 2
Port 3
Scheduling Type
Priority
Priority
Priority
Protocol Type
RIP
RIP
RIP
Periodic Time
30
30
30
Expiration Time
180
180
180
120
120
120
Local Preference
MED
If you want to select your internal gateway protocol as OSPF then here is the information
you need to fill in for Router properties
Router
BGP Router1
BGP Router2
Internal Router3
Properties
Port 1
Port 2
Port 1
Port 2
Port 1
Port 2
Port 3
Buffer Size
(KB)
Scheduling
Type
OSPF
BGP
BGP
OSPF
OSPF
OSPF
OSPF
Priority
255
255
255
255
255
Local
100
100
Protocol
Type
Preference
MED
- 88 -
Router Properties
Internal Router4
Port 1
Port 2
Port 3
Scheduling Type
Priority
Priority
Priority
Protocol Type
OSPF
OSPF
OSPF
Priority
255
255
255
Local Preference
MED
Link
Link 1
Link 7
Distance (km)
No
No
No
No
No
No
No
(BER)
Error
Error
Error
Error
Error
Error
Error
Physical
E2
E2
CAT5( 1000
CAT5( E2
10Mb
10Mb
Properties
Medium
Mbps
ps)
Link Weight
E2
ps)
1
- 89 -
Output:
After running this scenario, in Network performance screen, click View Routing table
link. Then the following screen would appear
If you click over the internal routers, you will get the RIP/OSPF routing table for internal
routers. If you click over the Border router 1 or 2, you will get the routing table for
Border routers. We have shown the routing tables for Border Router 1 and 2.
- 90 -
The Border Routers store the CPEs Network address in its Routing Table as shown in the
above Tables under Destination column.
Inference:
First the internal Routing tables (RIP/OSPF table) are formed among all the Routers
belonging to each of the Autonomous systems. The Border Routers containing the
network address of all the CPEs in its AS represents the routing table of its AS. Border
Routers in each AS, having ability to communicate with another AS, pass their Routing
tables resulting in the formation of external Routing tables (BGP table). Then actual
packet transmission takes place from Source to Destination between Autonomous
systems.
- 91 -
Experiment 15
Objective:
Study how the LSP varies for different traffic in MPLS -TE (Traffic Engineering)
Theory:
Traffic Engineering is the process of controlling how traffic flows through ones network
so as to optimize resource utilization and network performance. Traffic Engineering is
needed in the Internet mainly because current IGPs (Interior Gateway Protocols RIP,
OSPF) always use the shortest paths to forward all traffics. But MPLS with traffic
engineering use different paths to forward different traffics.
Procedure:
How to Create Scenario:
Create Scenario: Help NetSim Help Running Simulation via GUI MPLS
Networks Create Scenario.
Sample Inputs:
Follow the steps given in the different samples to arrive at the objective.
Sample 1:
In this Sample,
Router 2,3 and CPE 3,4 are connected with Router 4 by Link 5,6 7, 8 respectively
CPE 1
CPE2
Destination
CPE 3
CPE 4
Priority
Low
Low
Traffic Type
Data
Data
1472
1472
Distribution
Constant
Constant
1963
1963
- 92 -
Router Properties
Router1
Router2
Router3
Router4
Scheduling Type
Priority
Priority
Priority
Priority
Routing Properties
Protocol Type
OSPF
OSPF
OSPF
OSPF
Router Priority
255
255
255
255
Enable
Enable
MPLS Properties
Traffic Engineering
Enable
Enable
Link Properties
Link 1
Link 2
Link 3
Link 4
Distance (km)
No Error
No Error No Error
No Error
Physical Medium
E2
E2
Link Properties
Link 5
Link 6
Link 7
Link 8
Distance (km)
No Error
No Error
No Error
No Error
Physical Medium
E2
E2
Output:
After running this scenario, in Network performance screen, click View LSP link. Then
the following screen would appear.
Click 10.1.7.2(CPE-1) to view the LSP for CPE 1s traffic.
- 93 -
Reserved Bandwidth of CPE1s traffic is 6 Mbps. CPE 1s traffic is sent through 4 and 6
links. So Remaining Bandwidth of 4 and 6 links are 4 Mbps (10-6).
Click 10.1.8.2(CPE-2) to view the LSP for CPE 2s traffic.
Reserved Bandwidth of CPE 2s traffic is also 6 Mbps. Since Link 4 and 6s remaining
bandwidth is less than the Reserved Bandwidth of CPE 2s traffic, CPE 2s traffic is sent
through the another path through 3 and 5 links.
- 94 -
Sample 2:
In this Sample,
Router 2,3 and CPE 3,4 are connected with Router 4 by Link 5,6 7, 8 respectively
CPE Properties
CPE 1
CPE2
Destination
CPE 3
CPE 4
Priority
Low
Low
Traffic Type
Data
Data
1472
1472
Distribution
Constant
Constant
1963
1963
Link Properties
Link 1
Link 2
Link 3
Link 4
Distance (km)
No Error
No Error
No Error
No Error
Physical Medium
E2
E2
Link Properties
Link 5
Link 6
Link 7
Link 8
Distance (km)
No Error
No Error
No Error
No Error
Physical Medium
E2
E2
- 95 -
Router Properties
Router1
Router2
Router3
Router4
Scheduling Type
Priority
Priority
Priority
Priority
Routing Properties
Protocol Type
OSPF
OSPF
OSPF
OSPF
Router Priority
255
255
255
255
Disable
Disable
MPLS Properties
Traffic Engineering
Disable
Disable
Output:
After running this scenario, in Network performance screen, click View LSP link. Then
the following screen would appear.
Click 10.1.7.2(CPE-1) to view the LSP for CPE 1s traffic.
- 96 -
Inference:
In Traffic Engineered MPLS network, according to the traffic constraint different traffics
will be sent through different paths. But in without traffic engineering, all traffics will be
sent through same shortest path.
- 97 -
Experiment 16
Objective
Study how call blocking probability varies as the load on a GSM network is continuously
increased.
Procedure:
How to Create Scenario & Generate Traffic:
Please navigate through the below given path to,
Create Scenario: Help NetSim Help Running Simulation via GUI Cellular
Networks Create Scenario.
Inputs
Follow the steps given in the different samples to arrive at the objective.
In this Sample,
- 98 -
Set the properties of BTS and MS by following the tables for each sample,
BTS Properties
BTS1
891.0 MHz
890.0 MHz
936.0 MHz
935.0 MHz
Channel bandwidth
200 kHz
MS 1
MS 3
Destination
MS 2
MS 4
Transmission Type
Point to Point
Point to Point
Traffic Type
Voice
Voice
Call Details
Distribution
Exponential
Exponential
300
300
Distribution
Exponential
Exponential
Call Duration
60
60
Codec
Codec
GSM-FR
GSM-FR
Packet Size
33
33
20000
20000
Service Type
CBR
CBR
Generation rate
0.0132
0.0132
Mobility Model
No Mobility
No Mobility
- 99 -
MS 1
MS 3
MS 5
Destination
MS 2
MS 4
MS 6
Transmission Type
Point to Point
Point to Point
Point to Point
Traffic Type
Voice
Voice
Voice
Call Details
Distribution
Exponential
Exponential
Exponential
300
300
300
Distribution
Exponential
Exponential
Exponential
Call Duration
60
60
60
(sec)
Codec
Codec
GSM-FR
GSM-FR
GSM-FR
Packet Size
33
33
33
20000
20000
20000
Service Type
CBR
CBR
CBR
Generation rate
0.0132
0.0132
0.0132
Mobility Model
No Mobility
No Mobility
No Mobility
Cellular Networks
Select the Experiments (Note: Click one experiment after another to compare the
experiments in the Analytics interface).
- 100 -
Comparison Charts:
*** 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.
Inference
When the number of MS is increased from 4 to 22 the call blocking probability increases
from 0 to 0.48. This is because; 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 in
each base station is fixed (In this experiment it is 40).
Total number of channels in system = 40
Number of channels per BTS = 40/7 = 5
Number of traffic channels in each BTS = 4 (Here 1 channel is RACH)
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 8 MS may generate. Only after this
does the base station not finds free channels and block calls.
- 101 -
Experiment 17
Objective
Study how the number of channels increases and the Call blocking probability decreases
as the Voice activity factor of a CDMA network is decreased
Procedure:
How to Create Scenario & Generate Traffic:
Please navigate through the below given path to,
Create Scenario: Help NetSim Help Running Simulation via GUI Cellular
Networks Create Scenario.
Inputs
Follow the steps given in the different samples to arrive at the objective.
In all Samples,
Total no of MS used: 22
Set the properties of BTS and MS by following the tables for each sample,
- 102 -
MS Properties
Destination
Transmission
Type
Traffic Type
MS 1
MS 2
Point to Point
MS 3
MS 5
MS 4
MS 6
Point to
Point to
Point
Point
Voice
Voice
Call Details
Exponential
Exponential
300
300
MS 7
MS 8
Point to
Point
Voice
MS 9
MS 10
Point to
Point
Voice
Distribution
Mean Call
Interval Time
(sec)
Distribution
Call Duration
Exponential
300
Exponential
300
Exponential
300
Exponential
60
Exponential
60
GSM-FR
33
20000
Exponential
Exponential
60
60
Codec
GSM-FR
GSM-FR
33
33
20000
20000
Codec
Packet Size
Inter Arrival
Time (s)
Service Type
Generation rate
Mobility
Model
GSM-FR
33
20000
GSM-FR
33
20000
CBR
0.0132
No Mobility
CBR
0.0132
No Mobility
CBR
0.0132
No Mobility
CBR
0.0132
No Mobility
Voice
Exponential
60
CBR
0.0132
No Mobility
BTS Properties
BTS
Standards
IS95A/B
Total bandwidth
1.25 MHz
Chip rate
1.2288 McPS
1.0
Transmitter power
20 W
Fading figure
0.5
Standard deviation
11
Change the voice activity factor from 1.0, 0.9, 0.8, 0.7. to 0.1.
Simulation Time 1000 sec
- 103 -
Output
To view the output by using NetSim Sample experiments need to be added onto the
Analytics interface. Given below is the navigation for analytics Simulation Analytics
Select the experiments by selecting
Cellular Networks
Select the Experiments (Note: Click one experiment after another to compare the
experiments in the Analytics interface).
Chart 1
When the system Voice activity factor decreases from 1.0 to 0.1, the number of channels
increases from 3 to 37. (Note: All other parameters like Bandwidth 1.25 MHz, chip rate
1.2288McPS, target SNR 6, Path loss exponent 3, Fading figure 0, and standard deviation
11, are constant in all the samples taken.)
In CDMA network, the number of channels is inversely proportional to the voice activity
factor.
1
graph. (This is because VAF is decreasing along
x
+ve X)
- 104 -
Chart 2
*** 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.
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).
Let us also understand why the call blocking probability of Sample1, Sample2, and
Sample3 is equal and again is equal for Sample4, sample5. In this experiment, all the
mobile stations are placed on only BS: base station1. One call requires 2 channel (One is
for caller party and another is for called party). So, even if base station 1 has one free
channel, the also the call is blocked.
- 105 -
Sample1
Sample2
So, here also in this particular scenario where caller and called party are in BTS1, BTS1
can handle only 1 call at a time. The one extra channel that is not available in sample1 is
wasted throughout. So, number of blocked calls or call blocking probability is same as
sample1.
- 106 -
Experiment 18
Objective:
Study the SuperFrame Structure and the analyze the effect of SuperFrame order on
throughput
Introduction:
Coordinator in a PAN can optionally bound its channel time using a SuperFrame structure
which is bound by beacon frames and can have an active portion and an inactive portion.
The coordinator may enter a low-power (sleep) mode during the inactive portion.
The structure of this SuperFrame is described by the values of macBeaconOrder and
macSuperframeOrder. The MAC PIB attribute macBeaconOrder, describes the interval at
which the coordinator shall transmit its beacon frames. The value of macBeaconOrder,
BO, and the beacon interval, BI, are related as follows:
for 0 BO 14, BI = aBaseSuperframeDuration * 2BO symbols.
If BO = 15, the coordinator shall not transmit beacon frames except when requested to do
so, such as on receipt of a beacon request command. The value of macSuperframeOrder
shall be ignored if BO = 15.
An example of a SuperFrame structure is shown in following Figure.
- 107 -
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 of
Inactive part of
SuperFrame (%)
SuperFrame (%)
10
10
100
10
50
50
Throughput
estimated (%)
> 200% of T
Say T = 19.166
(Got from simulation)
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 same as the active part of the SuperFrame as sensors
can transmit a packet only in the active portion.
- 108 -
Simulation:
How to Create Scenario & Generate Traffic:
Please refer,
Create Scenario: Help NetSim Help Running Simulation via GUI Wireless
Sensor Networks Create Scenario.
Click & drop one Node onto the Simulation Environment as shown.
Values
Sink Node Properties: Change the following properties for PAN Coordinator.
Sink Node Properties
Values
Beacon Order
10
Run the simulation for different Super Frame Order (change from 10 to 3).
NetSim Experiment Manual
- 109 -
The following are the throughputs obtained from simulation for different SuperFrame
Orders.
SF
Order
Throughput
(Kbps)
10
10.05
5.09
2.540
1.286
0.6144
0.3008
0.1408
0.0576
Comparison Chart:
- 110 -
*** 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.
Inference:
From the comparison chart both the simulation and theoretical throughputs match except
for the case with no inactive period because a sensor will be idle if the last packet in its
queue is transmitted and if a packet is generated in inactive period then the packet has to
wait in the queue till the next SuperFrame and 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.
- 111 -
Experiment 19
Objective:
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.
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.
Theory:
A packet transmission begins with a random backoff (in number of slots, each slot of
20
followed by a
CCA.
A 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.
- 112 -
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.
Simulation:
How to Create Scenario:
Please navigate through the below given path for Create Scenario Help
Create Scenario: Help NetSim Help Running Simulation via GUI Personal
Area Networks Create Scenario.
Node Properties
Wireless Node 1
Transmission Type
Point-to-Point
Destination
Wireless Node 2
Traffic Type
Custom
Packet Size
Constant
Distribution
70
Packet Size (bytes)
Packet Inter Arrival Time
NetSim Experiment Manual
- 113 -
Constant
Distribution
Packet Inter Arrival Time(s) 4000
DSR Properties
Link Layer Ack
Ack Type
Data Link Layer
Enable
ACK Request
Max Frame Retries
Physical Layer
Transmitter power (mW)
(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.)
PAN Coordinator Properties:
Sink Node Properties
Values
Beacon Mode
Disable
Environment Properties:
Environment Properties
Values
Channel Characteristics
No Path Loss
- 114 -
70 bytes
8 bytes
28 bytes
MAC Header
5 bytes
PHY Header
6 bytes
Packet Size
117 bytes
117 bytes
3.5
Slots
0.4 0.6
SlotsSlots
Random
Turn
CCA
backoff
around
Avg [0,7]
Time
11.7 Slots
Packet
0.6 0.6
Slots Slots
Turn Ack
around
Time
From standard each slot has 20 Symbols in it and each symbol takes 16s for
transmission
16 s
Symbol
Slots
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
- 115 -
Total Time
5.568 ms
17.4 *
Inference:
Throughput from simulation
100.470 kbps
100.574 kbps
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
100.072
50
100.419
100
100.470
200
100.537
Note: In NetSim Academic version to run the simulation with 200 sec simulation time we
can use CLI.
- 116 -
4. Inside the properties window select Debugging and edit the Command Arguments
as shown
- 117 -
- 118 -
- 119 -
- 120 -
Procedure:
To begin with the experiment, open NetSim
Click on Programming from the menu bar, select framing Sequence and then select Bit
Stuffing
Step 1:
Select the User mode to write your own program in C/C++, compile and link to NetSim
software for validation. Click on the F1 (help) for details on how to proceed with your
own code.
Continue with the steps as given for Sample mode.
Select Mode
- 121 -
Step 2:
Here enter the source address, destination address and the data which you want to give as
an input. Now click Run button to execute the program.
Enter the
Source address
Enter the
Destination address
Enter the
input data
- 122 -
- 123 -
Algorithm:
1. Get the Value of Starting Delimiter, Destination Address, Source Address, Data,
Checksum and Ending Delimiter by reading Input.txt.
2. Call the function fnCharacterStuffing () to do the character stuffing process.
3. Loop through all the bytes in Destination Address
Check szDestinationAddress [nLoop1] != \0
sz_Stuffed_DestinationAddress [nIndex] = szDestinationAddress [nLoop1]
Increment nIndex by 1
Check szDestinationAddress [nLoop1] == szStartingDelimiter [0]
sz_Stuffed_DestinationAddress [nIndex] = szStartingDelimiter [0]
Increment nIndex by 1
Check szDestinationAddress [nLoop1] == szEndingDelimiter [0]
sz_Stuffed_DestinationAddress [nIndex] = szEndingDelimiter [0]
Increment nIndex by 1
Increment nLoop1 by 1
sz_Stuffed_DestinationAddress [nIndex] = '\0';
4. Similarly repeat step3 for Source Address, Data and Checksum.
5. Call the function fnDeStuffing () to do the destuffing process.
6. Copy all the bytes from Stuffed Destination Address to Destuffed Destination
Address
7. Loop through all the bytes in Destuffed Destination Address
Check sz_Destuffed_DestinationAddress [nLoop1] != \0
Check sz_Destuffed_DestinationAddress [nLoop1] ==
szStartingDelimiter [0] && sz_Destuffed_DestinationAddress [nLoop1]
== szEndingDelimiter [0]
Check nIndex < strlen (sz_Destuffed_DestinationAddress)
sz_DeStuffed_DestinationAddress [nIndex] =
sz_DeStuffed_DestinationAddress [nIndex + 2];
Increment nIndex by 1
nIndex = 0
Else if sz_Destuffed_DestinationAddress [nLoop1] ==
szStartingDelimiter [0] || sz_Destuffed_DestinationAddress [nLoop1] ==
szEndingDelimiter [0]
Check nIndex < strlen (sz_Destuffed_DestinationAddress)
sz_DeStuffed_DestinationAddress [nIndex] =
sz_DeStuffed_DestinationAddress [nIndex + 1];
Increment nIndex by 1
nIndex = 0
NetSim Experiment Manual
- 124 -
Increment nLoop1 by 1
8. Similarly repeat step7 for Source Address, Data and Checksum and write those
values into Output.txt.
Procedure:
To begin with the experiment, open NetSim
Click on Programming from the menu bar, select framing Sequence and then select
Character Stuffing
Step 1:
Select the User mode to write your own program in C/C++, compile and link to NetSim
software for validation. Click on the F1 (help) for details on how to proceed with your
own code.
Continue with the steps as given for Sample mode.
Select Mode
- 125 -
Step 2:
Here enter the source address, destination address, check sum, starting & ending delimiter
and the data which you want to give as an input. Now click Run button to execute the
program.
Enter the
Source address
Enter the
Destination address
Enter the input data
Enter the checksum
- 126 -
- 127 -
Repeat the above division processes until the quotient of the number is less than 2.
Finally we get the remainder string having 1s and 0s, which is the binary
representation of that character.
- 128 -
Continue above process for all the characters in the data string.
Divide the binary converted data string using the Generator Polynomial (given
above CRC 12).
If the leading bit of the binary data string is 0, do an XOR operation with the 13
bits of 0s and get the remainder which is also 13 bits.
Else if the leading bit of the binary data string is 1, do an XOR operation with
the 13 bits with binary converted CRC 12 polynomial and get the remainder which
is also 13 bits.
The first bit of the remainder is left out and the remainder is made to 12 bits.
If there are successive bits in the data, make the previous remainder bit to 13 bits
by bringing down the next bit in the data
Thus the output of this whole process will be a 3 - nibble checksum that is
attached to the transmitting frame.
Receiver side
Repeat the Steps 1 to 4 of the Sender side CRC coding and get the CRC value for
the data.
Convert the HEXA equivalent string to its binary format. This is the Hexadecimal
to binary conversion process.
Append the binary format of the above step to the CRC variable. Then append 12
0s to the CRC variable.
Repeat the Steps 6 and 7 of the Sender Side CRC coding to calculate the CRC
value for the receiver side.
- 129 -
Error Case
Sender side
Repeat the above division processes until the quotient of the number is less than 2.
Finally we get the remainder string having 1s and 0s, which is the binary
representation of that character.
Continue above process for all the characters in the data string.
Divide the binary converted data string using the Generator Polynomial (given
above CRC 12).
If the leading bit of the binary data string is 0, do an XOR operation with the 13
bits of 0s and get the remainder which is also 13 bits.
Else if the leading bit of the binary data string is 1, do an XOR operation with
the 13 bits with binary converted CRC 12 polynomial and get the remainder which
is also 13 bits.
The first bit of the remainder is left out and the remainder is made to 12 bits.
If there are successive bits in the data, make the previous remainder bit to 13 bits
by bringing down the next bit in the data
Thus the output of this whole process will be a 3-nibble checksum that is attached
to the transmitting frame.
- 130 -
Receiver side
Repeat the Steps 1 to 4 of the Sender side CRC coding and get the CRC value for
the data.
Make some errors in the string CRC by changing certain characters. The error
string is stored in the variable CRC.
Write the Error string CRC into the file Input.txt. The file path for the file
Input.txt" is the path where you have installed the NetSim application.
(Compulsory).
Convert the HEXA equivalent string CRC to its binary format. This is the
Hexadecimal to binary conversion process.
Append the binary format of the above step to the CRC variable. Then append 12
0s to the CRC variable.
Repeat the Steps 6 and 7 of the Sender Side CRC coding to calculate the CRC
value for the receiver side.
Procedure:
To begin with the experiment, open NetSim
Click on Programming in the menu bar, select Error Detecting Codes and then select
Cyclic Redundancy Check.
The scenario will be obtained as shown below. Follow the steps.
Step 1:
Select the User mode to write your own program in C/C++, compile and link to NetSim
software for validation. Click on the F1 (Help) for details on how to proceed with your
own code.
Continue with the steps as given for Sample mode.
- 131 -
Select Mode
Select any of
the
algorithms
Select Error
condition
Results:
Error condition: No Error
- 132 -
- 133 -
Each letter of the plain text is exchanged using another letter according to the key value
given by the user.
The user has to give the message and encrypt that message using the key value. The
encryption is done based on the ASCII value of the alphabetical letter and the key value.
ASCII value of each letter in the plain text is incremented by the key value. The
encrypted text is called as Cipher text.
Example - If the plain text first letter is A, ASCII value of A is 65 and the key value is 1
then the encrypted value is 65 + 1 = 66, which is B.
Plain text
tetcos
Key value
Cipher text
: ufudpt
ASCII value of each letter in the plain text is incremented by 1 (key value) and get the
cipher text.
Algorithm:
Read the plain text and key value from the input file.
- 134 -
3. If the plain text is alphabet then the cipher text should also be alphabet and
vice versa.
4. The alphabet series for this case is, a, b, c, d...x, y, z, a, b, c, d
A, B, C, DX, Y, Z, A, B, C
5. The user should add key value according to the process to be taken, in such a
way that the series should continue as explained in the previous point.
Procedure:
To begin with the experiment, open NetSim
Click on Programming from the menu bar, select Cryptography and then select
Substitution.
The scenario will be obtained as shown below. Follow the steps.
Step 1:
When you select the User mode, you have to write your own program in C/C++, compile
and link to NetSim software for validation. Click on the F1 (Help) for details on how to
proceed with your own code
Continue with the steps as given for Sample mode.
- 135 -
Select Mode
Encryption
Enter the plain text
Generated Cipher
text
Now select Decryption option and then click Run button to get back the original text.
NetSim Experiment Manual
- 136 -
Select Decryption
Click Run
- 137 -
The smallest edge from the list is selected and if the addition of the edge in the
spanning tree doesnt form a cycle, then the edge is added in the spanning tree. If
it forms a cycle, then that edge is discarded.
The above step is repeated until there are no edges in the list, or there are n-1
edges in spanning tree where n is number of nodes.
If there are n-1 edges in the spanning tree, the spanning tree for the graph is
formed.
If there are no edges in the list and there are less than n-1 edges in the spanning
tree, then no spanning tree can be formed for the graph.
- 138 -
Edge
Weight
Status
Switch3-Switch 6
20
Selected
Switch3-Switch4
20
Selected
Switch5-Switch6
40
Selected
Switch1-Switch2
50
Selected
Switch6-Switch1
50
Selected
Switch2-Switch3
60
Not Selected
Switch4-switch5
80
Not selected
List all the edges of the graph in the ascending order of weight.
Pick the smallest edge from the list and check if the addition of the edge in the
spanning tree doesnt form a cycle. Then add the edge in the spanning tree. If it
forms a cycle, then discard that edge. Note: Initially the spanning tree is empty.
Repeat the above step until there are no edges in the list, or there are n-1 edges in
spanning tree where n is number of nodes.
If there are n-1 edges in the spanning tree, the spanning tree for the graph is
formed
If there are no edges in the list and there are less than n-1 edges in the spanning
tree, then no spanning tree can be formed for the graph.
Procedure:
To begin with the experiment, open NetSim
Click on Programming from the menu bar, select Spanning tree.
- 139 -
Select Mode
Select Algorithm
Step 2:
Click on the one switch followed by the other to have a connection between them
and then click Run button to execute the program.
- 140 -
The lines in green color show the spanning tree path and the lines in red color shows the
blocked path.
Output Table
- 141 -
2. The Destination Node replies to the Source with an ARP Reply. The reply is sent
to the source in the ARP Reply Format. The ARP Reply Format contains
following details:
The IP Address of the Destination Node, i.e. Source IP. (Note: Here
Destination Node becomes the Source Node, since the ARP Reply is
transmitted by the Destination Node).
The IP Address of the Source Node, i.e. Destination IP. (Note: Here
Source Node becomes the Destination Node, since the ARP Reply is
delivered to the Source Node).
- 142 -
The MAC Address of the Source Node, i.e. Source MAC. In this case
Destination Node is the Source Node.
The MAC Address of the Destination Node, i.e. Destination MAC. In this
case Source Node is the Destination Node as it is receiving the ARP reply.
Algorithm:
1. Receive the inputs from the input file input.txt as defined in the Programming
Guidelines.
2. After reading the address, get the Class value of the source node and the
destination node.
3. If the Network address of the source and the destination are not same, then,
4. If the network address of the source and destination matches, but if the host id is
not present in the network list,
5. Else
Procedure:
To begin with the experiment, open NetSim
Click on Programming from the menu bar and select Address Resolution Protocol.
The scenario will be obtained as shown below. Follow the steps.
Step 1:
When you select the User mode, you have to write your own program in C/C++, compile
and link to NetSim software for validation. Click on the F1 (Help) for details on how to
proceed with your own code.
- 143 -
Step 2:
Step 3:
As soon as you select a particular number of nodes those many nodes will be created in
your environment which is shown below
- 144 -
Results:
After you click RUN button you can see the ARP request message being broadcasted
from the source node to all other nodes and destination node reply with an ARP reply
message to the source node as shown in the following screen shots.
- 145 -
- 146 -
Take the Next Router routing table and its neighbor routing table.
Add the router entry that is not in your own routing table, but exists in any one of the
other routing tables. If the new router entry exists in more than one neighbor, then
find the minimum cost among them. The minimum cost value details are taken as a
new entry: such as source router, intermediate router, destination router and cost
value, etc.
Update the source router routing table cost value if both the destination router and the
intermediate router field value have the same value as any one of the neighbors
routing entry.
Update the source routers routing table entry with the new advertised one if the
intermediate router value in the source table is not same, but the cost value is greater
than the its neighbors entry.
- 147 -
Check whether any changes are made in any of the routers. If yes, then repeat the above
steps, otherwise, quit the process.
Procedure:
To begin with the experiment, open NetSim
Click on Programming from the menu bar and select Distance Vector Routing
When you select the User mode, you have to write your own program in C/C++, compile
and link to NetSim software for validation. Click on the F1 (Help) for details on how to
proceed with your own code.
- 148 -
Output Table
- 149 -
Link state algorithm is a method used to find the shortest path between a source router
and a destination router based on the distance and route the packets through that route.
Algorithm:
1. Start with the router: the root of the tree
2. Assign a cost of 0 to this router and make it the first permanent router.
3. Examine each neighbor router of the router that was the last permanent router.
4. Assign a cumulative cost to each router and make it temporary.
5. Among the list of temporary routers
5. a. Find the router with the smallest cumulative cost and make it permanent.
5. b. If a router can be reached from more than one direction
5. b. 1. Select the direction with the shortest cumulative cost.
6. Repeat steps 3 to 5 until every router becomes permanent.
Procedure:
- 150 -
Select Mode
When you select the User mode, you have to write your own program in C/C++, compile
and link to NetSim software for validation. Click on F1 (Help) link for details on how to
proceed with your own code.
- 151 -
Output
table
- 152 -
Algorithm:
Start with the window size of 1 from the transmitting (Source) node.After transmission of
a frame the transmitting (Source) node waits for a reply (Acknowledgement) from the
receiving (Destination) node.
If the transmitted frame reaches the receiver (Destination) without error, the receiver
(Destination) transmits a Positive Acknowledgement.
If the transmitted frame reaches the receiver (Destination) with error, the receiver
(Destination) do not transmit acknowledgement.
If the transmitter receives a positive acknowledgement it transmits the next frame if any.
Else if the transmission timer expires, it retransmits the same frame again.
NetSim Experiment Manual
- 153 -
Select Mode
Stop & Wait
Enter input & error rate
When you select the User mode, you have to write your own program in C/C++, compile
and link to NetSim software for validation. Click on the F1 (help) icon for details on how
to proceed with your own code.
- 154 -
Continue with the steps as given for sample mode. As soon as you begin to enter the input
data file the following window appears and you select the input data file from where you
have stored.
Data file
that is added
Result:
Click Run button to view the output.
Output table
Inference:
Due to increase in the error rate, no of errored packets also increase. If errored packets
increase no of retransmitted packets also increase.
- 155 -
- 156 -
Algorithm:
The source node transmits the frames continuously.
Each frame in the buffer has a sequence number starting from 1 and increasing up to the
window size.
The source node has a window i.e. a buffer to store the frames. This buffer size is the
number of frames to be transmitted continuously.
The size of the window depends on the protocol designer.
For the first frame, the receiving node forms a positive acknowledgement if the frame is
received without error.
If subsequent frames are received without error (up to window size) cumulative positive
acknowledgement is formed.
If the subsequent frame is received with error, the cumulative acknowledgment error-free
frames are transmitted. If in the same window two frames or more frames are received
with error, the second and the subsequent error frames are neglected. Similarly even the
frames received without error after the receipt of a frame with error are neglected.
The source node retransmits all frames of window from the first error frame.
If the frames are errorless in the next transmission and if the acknowledgment is error
free, the window slides by the number of error-free frames being transmitted.
If the acknowledgment is transmitted with error, all the frames of window at source are
retransmitted, and window doesnt slide.
This concept of repeating the transmission from the first error frame in the window is
called as GOBACKN transmission flow control protocol.
Procedure:
To begin with the experiment, open NetSim.
Click on Programming from the menu bar and select Transmission Flow Control.
The scenario will be as shown in the following two figures.
- 157 -
Select Mode
Go Back N
Enter input & bit error rate
Click Run to
execute program
When you select the User mode, you have to write your own program in C/C++, compile
and link to NetSim software for validation. Click on F1 (help) for details on how to
proceed with your own code.
Continue with the steps as given for sample mode. As soon as you begin to enter the input
data file the following window appears and you select the input data file from where you
have stored.
- 158 -
Output table
- 159 -
Fewer retransmissions.
Disadvantages:
Operations:
A station may send multiple frames as allowed by the window size.
Receiver sends a negative ACK if frame i has an error. After that, the receiver does not
discard all incoming frames as in Go Back N.
If sender receives a negative ACK it will retransmit only frame i which is the error frame.
- 160 -
Algorithm:
The source node transmits the frames continuously.
Each frame in the buffer has a sequence number starting from 1 and increasing up to the
window size.
The source node has a window i.e. a buffer to store the frames. This buffer size is the
number of frames to be transmitted continuously.
The receiver has a buffer to store the received frames. The size of the buffer depends
upon the window size defined by the protocol designer.
The size of the window depends according to the protocol designer.
The source node transmits frames continuously till the window size is exhausted. If any of
the frames are received with error only those frames are requested for retransmission
(with a negative acknowledgement)
If all the frames are received without error, a cumulative positive acknowledgement is
sent.
If there is an error in frame 3, an acknowledgement for the frame 2 is sent and then only
Frame 3 is retransmitted. Now the window slides to get the next frames to the window.
If acknowledgment is transmitted with error, all the frames of window are retransmitted.
Else ordinary window sliding takes place. (* In implementation part, Acknowledgment
error is not considered)
If all the frames transmitted are errorless the next transmission is carried out for the new
window.
This concept of repeating the transmission for the error frames only is called Selective
Repeat transmission flow control protocol.
Procedure:
To begin with the experiment, open NetSim.
Click on Programming from the menu bar and select Transmission Flow Control.
- 161 -
Select mode
Selective Repeat
Enter input & bit error rate
When you select the User mode, you have to write your own program in C/C++, compile
and link to NetSim software for validation. Click on the F1 (help) for details on how to
proceed with your own code.
Continue with the steps as given for sample mode. As soon as you begin to enter the input
data file the following window appears and you select the input data file from where you
have stored.
- 162 -
Output table
- 163 -