89
NetSim Experiment Manual NetSim TM Experiment Manua - 1 - al

VTU Network Lab Experiment Manual - NetSim

  • Upload
    shulini

  • View
    544

  • Download
    18

Embed Size (px)

DESCRIPTION

Complete Lab manual for VTU computer networks lab 10CSL77

Citation preview

NetSim Experiment Manual

NetSimTM

Experiment Manual

- 1 -

Experiment Manual

NetSim Experiment Manual

The information contained in this document represents the current view of TETCOS on

the issues discussed as of the date of

changing market conditions, it should not be interpreted to be a commitment on the part

of TETCOS, and TETCOS cannot guarante

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

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

manual you do so at your own risk and on the understanding that

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, th

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-

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.0.9 (V), Sep 2013, TETCOS. All rights reserved.

All trademarks are property of their respective owner.

Contact us at –

TETCOS

214, 39th A Cross, 7th Main, 5th Block Jayanagar,

Bangalore - 560 041, Karnataka, INDIA. Phone: +91 80 26630624

E-Mail: [email protected]

Visit: www.tetcos.com

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 informati

is for informational purposes only. TETCOS MAKES NO WARRANTIES,

EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS

Warning! DO NOT COPY

Copyright in the whole and every part of this manual belongs to TETCOS

ansferred, 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

manual you do so at your own risk and on the understanding that TETCOS

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,

-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

2013, TETCOS. All rights reserved.

All trademarks are property of their respective owner.

214, 39th A Cross, 7th Main, 5th Block Jayanagar,

560 041, Karnataka, INDIA. Phone: +91 80 26630624

- 2 -

The information contained in this document represents the current view of TETCOS on

publication. Because TETCOS must respond to

changing market conditions, it should not be interpreted to be a commitment on the part

e the accuracy of any information presented

is for informational purposes only. TETCOS MAKES NO WARRANTIES,

EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS

TETCOS and may not

ansferred, copied or reproduced in whole or in part in any manner or in

TETCOS. If you use this

TETCOS shall not be

TETCOS may have patents, patent applications, trademarks, copyrights, or other

intellectual property rights covering subject matter in this document. Except as expressly

e 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,

ces, 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

NetSim Experiment Manual

List of Experiments

Introduction

1. Introduce students to network simulation through the

Create a simple network model with multiple scenarios, Collect statistics on

network performance through the use of

conclusions on network performance.

Simulation Experiments

2. Simulate a three nodes point

Set the queue size and vary the bandwidth and find the number of packets dropped

3. Simulate a four node point

n0 – n2, n1 – n2 and n2

n1-n3. Apply relevant applications over TCP and UDP agents changing the

parameter and determine the number of packets sent by TCP / UDP

4. Simulate the different types of Internet traffic such as FTP and TELNET over a

network and analyze the throughput

5. Simulate the transmission of ping messages over a network topology consisting of

6 nodes and find the number of

6. Simulate an Ethernet LAN using n nodes (6

and compare throughput

7. Simulate an Ethernet LAN using n nodes and set multiple traffic nodes and

determine collision across different nodes

8. Simulate an Ethernet LAN using n nodes and set multiple traffic nodes and plot

congestion window for different source / destination

9. Simulate simple ESS and with transmitting nodes in wire

and determine the performance with respect to transmission of packets

List of Experiments

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

ns on network performance.

nts

Simulate a three nodes point – to – point network with duplex links between them.

Set the queue size and vary the bandwidth and find the number of packets dropped

Simulate a four node point-to-point network with the links connected as follows:

n2 and n2 – n3. Apply TCP agent between n0-n3 and UDP between

n3. Apply relevant applications over TCP and UDP agents changing the

parameter and determine the number of packets sent by TCP / UDP

Simulate the different types of Internet traffic such as FTP and TELNET over a

network and analyze the throughput

Simulate the transmission of ping messages over a network topology consisting of

6 nodes and find the number of packets dropped due to congestion

Simulate an Ethernet LAN using n nodes (6-10), change error rate and data rate

and compare throughput

Simulate an Ethernet LAN using n nodes and set multiple traffic nodes and

collision across different nodes

Simulate an Ethernet LAN using n nodes and set multiple traffic nodes and plot

congestion window for different source / destination

Simulate simple ESS and with transmitting nodes in wire-less LAN by simulation

and determine the performance with respect to transmission of packets

- 3 -

simulation package,

Create a simple network model with multiple scenarios, Collect statistics on

tools, Analyze statistics and draw

…..Page (5)

point network with duplex links between them.

Set the queue size and vary the bandwidth and find the number of packets dropped

…..Page (10)

connected as follows:

n3 and UDP between

n3. Apply relevant applications over TCP and UDP agents changing the

parameter and determine the number of packets sent by TCP / UDP

…..Page (15)

Simulate the different types of Internet traffic such as FTP and TELNET over a

…..Page (20)

Simulate the transmission of ping messages over a network topology consisting of

packets dropped due to congestion …..Page (25)

10), change error rate and data rate

…..Page (31)

Simulate an Ethernet LAN using n nodes and set multiple traffic nodes and

…..Page (41)

Simulate an Ethernet LAN using n nodes and set multiple traffic nodes and plot

…..Page (45)

s LAN by simulation

and determine the performance with respect to transmission of packets

…..Page (50)

NetSim Experiment Manual

Programming Exercises:

your code to NetSim

How to De-bug your code linked to NetSim’s

(Important: If you are opening the source code via “

available under Programming Exercise,

directly. Save the file in different location

original source file is not modified

10. Write a program for error detecting code using CRC

11. Write a program for frame sorting technique used in buffers

12. Write a program for distance vector algorithm to find suitable path for

transmission.

13. Using TCP/IP sockets, write a client

file name and to make the server send back the contents of the r

present

14. Implement the above program using as message queues or FIFOs as IPC channels

(Note: This experiment is not available in NetSim)

15. Write a program for simple RSA algorithm to encrypt and decrypt the data

16. Write a program for Hamming code generation for error detection and correction

17. Write a program for congestion control using leaky bucket algorithm

Exercises: Write a C program for the following exercises and link

bug your code linked to NetSim’s Programming Exercise

If you are opening the source code via “Interface Source Code

available under Programming Exercise, then don’t make modifications in the opened file

in different location and do the modifications to ensure that

modified)

Write a program for error detecting code using CRC-CCITT (16-

Write a program for frame sorting technique used in buffers

Write a program for distance vector algorithm to find suitable path for

Using TCP/IP sockets, write a client – server program to make the client send the

file name and to make the server send back the contents of the requested file if

Implement the above program using as message queues or FIFOs as IPC channels

(Note: This experiment is not available in NetSim)

Write a program for simple RSA algorithm to encrypt and decrypt the data

Write a program for Hamming code generation for error detection and correction

Write a program for congestion control using leaky bucket algorithm

- 4 -

a C program for the following exercises and link

Interface Source Code” link

make modifications in the opened file

to ensure that the

bits)

…..Page (61)

…..Page (67)

Write a program for distance vector algorithm to find suitable path for

…..Page (70)

server program to make the client send the

equested file if

…..Page (73)

Implement the above program using as message queues or FIFOs as IPC channels

Write a program for simple RSA algorithm to encrypt and decrypt the data

…..Page (78)

Write a program for Hamming code generation for error detection and correction

…..Page (81)

Write a program for congestion control using leaky bucket algorithm

…..Page (86)

NetSim Experiment Manual

Experiment 1

Objective: Introduce students to network simulation through the

package. Create a simple network model with multiple scenarios, Collect statistics on

network performance through the use of

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 metr

• What is a network?

A network is a set of hardware devices connected together, either physically or logically.

This allows them to exchange information.

A network is a system that provides its users with unique capabilities, above and beyond

what the individual machines and their software applications can provide.

• What is simulation?

A simulation is the imitation of the operation of a real

time.

Network simulation is a technique where a program models the behavior of a

either by calculating the interaction between the different network entities

(hosts/routers, data links, packets

and playing back observations from a production network. The behavior of the network

and the various applications and services it supports can then be observed in a test lab;

various attributes of the environment can also be modified in a controlled manner to

assess how the network would behave under different conditions.

Introduce students to network simulation through the NetSim

Create a simple network model with multiple scenarios, Collect statistics on

network performance through the use of NetSim tools and Analyze statistics and draw

network performance.

Introduce students to network simulation through the NetSim simulation package.

is a network simulation tool that allows you to create network scenarios, model

traffic, and study performance metrics.

A network is a set of hardware devices connected together, either physically or logically.

This allows them to exchange information.

A network is a system that provides its users with unique capabilities, above and beyond

ndividual machines and their software applications can provide.

A simulation is the imitation of the operation of a real-world process or system over

is a technique where a program models the behavior of a

either by calculating the interaction between the different network entities

packets, etc) using mathematical formulae, or actually capturing

and playing back observations from a production network. The behavior of the network

various applications and services it supports can then be observed in a test lab;

various attributes of the environment can also be modified in a controlled manner to

assess how the network would behave under different conditions.

- 5 -

NetSim simulation

Create a simple network model with multiple scenarios, Collect statistics on

Analyze statistics and draw

Introduce students to network simulation through the NetSim simulation package.

is a network simulation tool that allows you to create network scenarios, model

A network is a set of hardware devices connected together, either physically or logically.

A network is a system that provides its users with unique capabilities, above and beyond

ndividual machines and their software applications can provide.

world process or system over

is a technique where a program models the behavior of a network

either by calculating the interaction between the different network entities

, etc) using mathematical formulae, or actually capturing

and playing back observations from a production network. The behavior of the network

various applications and services it supports can then be observed in a test lab;

various attributes of the environment can also be modified in a controlled manner to

NetSim Experiment Manual

• What does NetSim provide?

Simulation: NetSim provides

networks as follows: Internetworks,

Networks, Advanced Wireless Networks,

Networks, Personal Area Networks

save, and delete experiments as desired. The different experiments can also be analyzed

using the analytics option in the simulation menu.

Programming: NetSim covers various programming exercises along with concepts,

algorithms, pseudo code and flowcharts. Users can also w

C/C++ and can link them to NetSim.

Some of the programming concepts are Address resolution protocol (ARP),

inter domain routing (CIDR), Cryptography, Distance vector routing, shortest path,

Subnetting etc.

Real time: Frame capture is

there is an active data transfer taking place and also prov

Basics: NetSim basics, gives a brief introduction and theoretical knowledge on different

Internetworks, Legacy Networks,

Networks, Cellular Networks

for better understandability of networking concepts.

Utilities: This section handles the user management section used for adding/deleting

users, setting passwords etc.

provide?

provides simulation of various protocols working in various

Internetworks, Legacy Networks, BGP Networks

ireless Networks, Cellular Networks, Wireless Sensor

Networks, Personal Area Networks and Cognitive Radio Networks. Users can open,

save, and delete experiments as desired. The different experiments can also be analyzed

using the analytics option in the simulation menu.

vers various programming exercises along with concepts,

algorithms, pseudo code and flowcharts. Users can also write their own source codes in

link them to NetSim.

Some of the programming concepts are Address resolution protocol (ARP),

inter domain routing (CIDR), Cryptography, Distance vector routing, shortest path,

is covered in this section. It is used to capture packets when

there is an active data transfer taking place and also provides performance metrics.

NetSim basics, gives a brief introduction and theoretical knowledge on different

Internetworks, Legacy Networks, BGP Networks, MPLS Networks, Advanced wireless

Networks, Cellular Networks and devices. Basics also provide more than 200 animations

for better understandability of networking concepts.

This section handles the user management section used for adding/deleting

- 6 -

various protocols working in various

BGP Networks, MPLS

ireless Sensor

. Users can open,

save, and delete experiments as desired. The different experiments can also be analyzed

vers various programming exercises along with concepts,

rite their own source codes in

Some of the programming concepts are Address resolution protocol (ARP), Classless

inter domain routing (CIDR), Cryptography, Distance vector routing, shortest path,

is used to capture packets when

ides performance metrics.

NetSim basics, gives a brief introduction and theoretical knowledge on different

, MPLS Networks, Advanced wireless

more than 200 animations

This section handles the user management section used for adding/deleting

NetSim Experiment Manual

Part B:

Create a Simple network model with multiple

performance through the use of NetSim. Analyze statistics and draw conclusion on

network performance.

Theory:

• Network model: A Network model

relationships. Networking devices like hubs, switches, routers, nodes, connecting

wires etc. are used to create a network model.

• Scenario: A Scenario is a narrative describing foreseeable interactions of types of

input data and its respective output data in the system.

• Network performance:

of a network are:-

Utilization is the fraction of the available bandwidth used for transmission of data

expressed as a percentage (%).

Delay is the amount of time taken for a packet to travel from one end of the network

to the other.

Drag and

drop the

hub

Drag and

drop the

node

Create a Simple network model with multiple scenarios. Collect statistics on network

performance through the use of NetSim. Analyze statistics and draw conclusion on

A Network model is a flexible way of representing devices and their

ing devices like hubs, switches, routers, nodes, connecting

wires etc. are used to create a network model.

Scenario is a narrative describing foreseeable interactions of types of

input data and its respective output data in the system.

The fundamental parameters that measure the performance

is the fraction of the available bandwidth used for transmission of data

expressed as a percentage (%).

is the amount of time taken for a packet to travel from one end of the network

- 7 -

scenarios. Collect statistics on network

performance through the use of NetSim. Analyze statistics and draw conclusion on

devices and their

ing devices like hubs, switches, routers, nodes, connecting

Scenario is a narrative describing foreseeable interactions of types of

The fundamental parameters that measure the performance

is the fraction of the available bandwidth used for transmission of data

is the amount of time taken for a packet to travel from one end of the network

Right click

on node to

set properties

Click here

to simulate

Click here

to enable

the trace

NetSim Experiment Manual

Delay= queuing delay (ms) + transmissio

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 wa

access the medium.

• What are network statistics?

Network statistics are network performance related

simulation run. The report at the end of the completion of an simulation experiment

include metrics like throughput, simulation time, frames generated, frames dropped,

frames errored, collision counts etc, and their respective values.

• What is NetSim analytics used for?

It is used to compare and analyze

Legacy Networks, BGP Networks

Cellular Networks, Wireless Sensor Networks,

Radio Networks. Parameters like utilization, loss, queuing delay, transmission time

etc of different sample experiments are compared with help of graphs.

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

What are network statistics?

Network statistics are network performance related metrics collected at the end of a

simulation run. The report at the end of the completion of an simulation experiment

metrics like throughput, simulation time, frames generated, frames dropped,

frames errored, collision counts etc, and their respective values.

What is NetSim analytics used for?

It is used to compare and analyze various protocols scenarios under Internetworks,

BGP Networks, MPLS Networks, Advanced wireless Networks,

Cellular Networks, Wireless Sensor Networks, Personal Area Networks and Cognitive

. Parameters like utilization, loss, queuing delay, transmission time

etc of different sample experiments are compared with help of graphs.

- 8 -

n 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

its in the head of the queue to

collected at the end of a

simulation run. The report at the end of the completion of an simulation experiment

metrics like throughput, simulation time, frames generated, frames dropped,

Internetworks,

, MPLS Networks, Advanced wireless Networks,

Personal Area Networks and Cognitive

. Parameters like utilization, loss, queuing delay, transmission time

etc of different sample experiments are compared with help of graphs.

Metrics

Click to

export the

values to

excel sheet

Click to view

the network

Click to edit

and re-run

NetSim Experiment Manual

- 9 -

Plot the chart

here

Click on

protocols to

select the

experiments

Click to

select the

metrics

NetSim Experiment Manual

Experiment 2

Objective:

Simulate a three nodes point

queue size and vary the bandwidth and find the number of packets dropped

Theory:

Router forwards packets from o

packets is greater than the service (

the buffer (queue) is completely f

Procedure:

How to Create Scenario & Generate Traffic:

o Create Scenario: “Help

Internetworks � Create Scenario”.

Sample Inputs:

In this experiment, 1 Router and 3

Simulation environment as shown below,

Simulate a three nodes point – to – point network with duplex links between them. Set the

queue size and vary the bandwidth and find the number of packets dropped

packets from one network to another network. When arrival rate of

service (departure) rate, packets get buffered (que

is completely filled, all arriving packets will be dropped.

How to Create Scenario & Generate Traffic:

“Help � NetSim Help F1 � Running Simulation via GUI

Create Scenario”.

xperiment, 1 Router and 3 Wired Nodes need to be clicked & dropped onto the

as shown below,

- 10 -

point network with duplex links between them. Set the

queue size and vary the bandwidth and find the number of packets dropped.

arrival rate of

queued). Once

, all arriving packets will be dropped.

Running Simulation via GUI �

dropped onto the

NetSim Experiment Manual

Sample 1:

Wired Node Properties:

Node Properties

Destination

Traffic Type

Distribution

Packet

Distribution

Packet Inter

Arrival Time (m

TCP

Router Properties: Set buffer size to 8 MB. Accept default values for remaining

parameters.

Wired Link Properties:

Link Properties

Medium Type

Uplink Speed (Mbps)

Downlink Speed (Mbps)

Uplink BER

Downlink BER

Node Properties Wired Node 1

Destination Wired Node 2

Traffic Type Custom

Packet Size

Distribution Constant

Packet Size (Bytes) 1460

Packet Inter Arrival Time

Distribution Constant

Packet Inter

Arrival Time (ms)

1200

TCP Properties

Disable

Set buffer size to 8 MB. Accept default values for remaining

Wired Link 1 Wired Link 2

CAT-5 CAT-

10 10

peed (Mbps) 10 10

No Error No Error

No Error No Error

- 11 -

Set buffer size to 8 MB. Accept default values for remaining

Wired Link 2

-5

No Error

No Error

NetSim Experiment Manual

Simulation Time - 100 Sec

(Note: The Simulation Time can be selected only after the following two tasks,

• Set the properties for the Wired Nodes, Router

• Click on the Simulate button

Upon completion of the experiment “Save”

carried out in the “Analytics” section by using export to Excel

Sample 2:

Wired Node Properties:

Node Properties

Destination

Traffic Type

Distribution

File Size (Bytes)

Distribution

Packet Inter

Arrival Time (m

TCP

Router Properties: Set buffer size to 8 MB. Accept default values for remaining

parameters.

The Simulation Time can be selected only after the following two tasks,

ies for the Wired Nodes, Router and Wired Links.

Click on the Simulate button).

Upon completion of the experiment “Save” the experiments for comparisons that can be

carried out in the “Analytics” section by using export to Excel.

Node Properties Wired Node 1

Destination Wired Node 2

Traffic Type Custom

Packet Size

Distribution Constant

Size (Bytes) 1460

Packet Inter Arrival Time

Distribution Constant

Packet Inter

Arrival Time (ms)

1200

TCP Properties

Disable

Set buffer size to 8 MB. Accept default values for remaining

- 12 -

The Simulation Time can be selected only after the following two tasks,

for comparisons that can be

Set buffer size to 8 MB. Accept default values for remaining

NetSim Experiment Manual

Wired Link Properties:

Link Properties

Medium Type

Uplink Speed (Mbps)

Downlink Speed (Mbps)

Uplink BER

Downlink BER

Simulation Time - 100 Sec

(Note: The Simulation Time can be selected only after the following two tasks,

• Set the properties for the Wired Nodes, Routers and Wired

• Click on the Simulate button

Change the medium type of Wired Link 2 to T2, E1, T1 and E0 to get Samples 3, 4, 5 and

6 respectively. The remaining properties for these samples are same as that of Samples 1

and 2.

Simulation Time - 100 Sec

(Note: The Simulation Time can be selected only after the following two tasks,

• Set the properties for the Wired Nodes, Routers and Wired

• Click on the Simulate button

Upon completion of the experiment “Save”

carried out in the “Analytics” section by using export to Excel

Output:

Open the Excel file and note down the number of packets dropped as shown in below

table. These values are available under queue metrics in the metrics screen of NetSim

also.

Wired Link 1 Wired Link 2

CAT-5 E2

10 8.448

peed (Mbps) 10 8.448

No Error No Error

No Error No Error

The Simulation Time can be selected only after the following two tasks,

the properties for the Wired Nodes, Routers and Wired Links.

Simulate button).

Change the medium type of Wired Link 2 to T2, E1, T1 and E0 to get Samples 3, 4, 5 and

6 respectively. The remaining properties for these samples are same as that of Samples 1

The Simulation Time can be selected only after the following two tasks,

the properties for the Wired Nodes, Routers and Wired Links.

Simulate button).

Upon completion of the experiment “Save” the experiments for comparisons that can be

carried out in the “Analytics” section by using export to Excel.

the Excel file and note down the number of packets dropped as shown in below

table. These values are available under queue metrics in the metrics screen of NetSim

- 13 -

Wired Link 2

8.448

8.448

No Error

No Error

The Simulation Time can be selected only after the following two tasks,

Change the medium type of Wired Link 2 to T2, E1, T1 and E0 to get Samples 3, 4, 5 and

6 respectively. The remaining properties for these samples are same as that of Samples 1

The Simulation Time can be selected only after the following two tasks,

for comparisons that can be

the Excel file and note down the number of packets dropped as shown in below

table. These values are available under queue metrics in the metrics screen of NetSim

NetSim Experiment Manual

Sample

Graph I

Inference

The number of packets dropped decreases

from the Graph I it can be inferred that a

arrival rate is higher than the rate at which

As a result queue size increases quickly and the buffer gets filled. Hence the newly arrive

packets at the queue will be dropped.

0

10000

20000

30000

40000

50000

60000

70000

80000

0.064 Mbps

Dro

pp

ed

Pa

cke

ts

Sample Number Number of packets

dropped

1 0

2 7158

3 24666

4 59725

5 63912

6 76088

number of packets dropped decreases as the link speed of wired link

ph I it can be inferred that as the link speed of second link decreases, packets

arrival rate is higher than the rate at which packets are forwarded by the Router via link 2.

As a result queue size increases quickly and the buffer gets filled. Hence the newly arrive

packets at the queue will be dropped.

1.54 Mbps 2.048 Mbps 6.312 Mbps 8.448 Mbps

Link speed of Wired Link 2

Dropped Packets

- 14 -

increases. Hence

s the link speed of second link decreases, packets

packets are forwarded by the Router via link 2.

As a result queue size increases quickly and the buffer gets filled. Hence the newly arrive

10 Mbps

NetSim Experiment Manual

Experiment 3

Objective:

Simulate a four node point-to

n0 – n2, n1 – n2 and n2 – n3. Apply TCP agent between n0

Apply relevant applications over TCP and UDP agents changing the parameter and

determine the number of packets sent by TCP / UDP.

Theory:

TCP:

TCP recovers data that is damaged, lost, duplicated, or

internet communication system. This

octet transmitted, and requiring a positive acknowledgment (ACK) from the

TCP. If the ACK is not received within a timeout

the receiver side sequence number is used

the segments in correct order

Therefore, in TCP no transmission

UDP:

UDP uses a simple transmission model with a minimum of protocol mechanism. It has no

handshaking dialogues, and thus exposes any unreliability of th

protocol to the user's program. As this is normally IP over unreliable media, there is no

guarantee of delivery, ordering or duplicate protection

Procedure:

How to Create Scenario & Generate Traffic:

o Create Scenario: “Help

Internetworks � Create Scenario”.

Click & drop Router and Wired Nodes onto the Simulation Environment as shown below.

to-point network with the links connected as follows:

n3. Apply TCP agent between n0-n3 and UDP between n1

Apply relevant applications over TCP and UDP agents changing the parameter and

determine the number of packets sent by TCP / UDP.

data that is damaged, lost, duplicated, or delivered out of order by the

internet communication system. This is achieved by assigning a sequence

transmitted, and requiring a positive acknowledgment (ACK) from the

TCP. If the ACK is not received within a timeout interval, the data is retransmitted. At

sequence number is used to eliminate the duplicates as well as to

in correct order since there is a chance of “out of order” reception

no transmission errors will affect the correct delivery of data.

UDP uses a simple transmission model with a minimum of protocol mechanism. It has no

handshaking dialogues, and thus exposes any unreliability of the underlying network

protocol to the user's program. As this is normally IP over unreliable media, there is no

guarantee of delivery, ordering or duplicate protection.

How to Create Scenario & Generate Traffic:

“Help � NetSim Help F1 � Running Simulation via GUI

Create Scenario”.

Click & drop Router and Wired Nodes onto the Simulation Environment as shown below.

- 15 -

the links connected as follows:

n3 and UDP between n1-n3.

Apply relevant applications over TCP and UDP agents changing the parameter and

order by the

chieved by assigning a sequence number to each

transmitted, and requiring a positive acknowledgment (ACK) from the receiving

retransmitted. At

to eliminate the duplicates as well as to order

reception.

errors will affect the correct delivery of data.

UDP uses a simple transmission model with a minimum of protocol mechanism. It has no

e underlying network

protocol to the user's program. As this is normally IP over unreliable media, there is no

Running Simulation via GUI �

Click & drop Router and Wired Nodes onto the Simulation Environment as shown below.

NetSim Experiment Manual

Sample Inputs:

Sample 1:

Set the properties for the devices and links as shown below:

Wired Node Properties:

Wired Node Properties

Destination

Traffic Type

Distribution

Packet Size (Bytes)

Distribution

Packet Inter Arrival

Time (ms)

TCP

UDP

Set the properties for the devices and links as shown below:

Wired Node Properties Wired Node 1 Wired Node 2

Wired Node 3 Wired Node 3

Custom Custom

Packet Size

Constant Constant

Packet Size (Bytes) 1460 1460

Packet Inter Arrival Time

Constant Constant

Packet Inter Arrival 10000 10000

TCP Properties

Enable Disable

UDP Properties

Disable Enable

- 16 -

Wired Node 2

Wired Node 3

NetSim Experiment Manual

Router Properties:

Accept the default properties for Router.

Wired Link Properties:

Accept the default properties for

Simulation Time - 100 Sec

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties for Wired Nodes , Switches, &Wired Links

• Then click on the Simulate button)

Sample 1: Wired Node 1 and Wired Node 2

Packet Inter Arrival Time

Likewise do the Sample 2 and Sample 3 by decreasing the

5000 ms and 2500 ms respectively.

(Note: “Packet Inter Arrival Time

Simulation Time - 100 Sec

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties for Wired Nodes ,

• Then click on the Simulate button)

Comparison Chart:

(Note: The Number of Segments Sent

Datagram Received will be available in the TCP Metrics and UDP Metrics of

“Performance Metrics” screen of NetSim

Accept the default properties for Router.

Accept the default properties for all Wired Links.

The Simulation Time can be selected only after doing the following two tasks,

Set the properties for Wired Nodes , Switches, &Wired Links

Then click on the Simulate button).

and Wired Node 2 transmit data to Wired Node 3 with the

Packet Inter Arrival Time as 10000 ms.

Likewise do the Sample 2 and Sample 3 by decreasing the Packet Inter Arrival Time

respectively.

Packet Inter Arrival Time (ms)” field is available in Wired Node Properties)

The Simulation Time can be selected only after doing the following two tasks,

Set the properties for Wired Nodes , Router &Wired Links

Then click on the Simulate button).

Segments Sent, Segments Received and Datagram Sent,

will be available in the TCP Metrics and UDP Metrics of

screen of NetSim)

- 17 -

The Simulation Time can be selected only after doing the following two tasks,

data to Wired Node 3 with the

Packet Inter Arrival Time as

field is available in Wired Node Properties)

The Simulation Time can be selected only after doing the following two tasks,

Datagram Sent,

will be available in the TCP Metrics and UDP Metrics of

NetSim Experiment Manual

Graph I

(Note: The “Packets transmitted successfully” for TCP is

UDP is Datagram Received

Number of packets transmitted successfully in TCP and UDP

Graph II

Number of lost packets in TCP and UDP

(Note: To get the “No. of packet lost

Sent and Segments Received

and Datagram Received)

0

5000

10000

15000

20000

25000

30000

35000

40000

45000

10000

Pa

cke

ts t

ran

smit

ted

su

cce

ssfu

lly

he “Packets transmitted successfully” for TCP is Segments Received

Datagram Received of the destination node i.e., Wired Node 3)

Number of packets transmitted successfully in TCP and UDP

Number of lost packets in TCP and UDP

acket lost”, For TCP, get the difference between

Segments Received and for UDP, get the difference between Datagram Sent

10000 5000 2500

Inter arrival time (Micro Sec)

TCP vs UDP

- 18 -

Segments Received and for

, get the difference between Segments

Datagram Sent

TCP

UDP

NetSim Experiment Manual

Inference:

Graph I, shows that the number of successful packets transmitted in TCP is

(or equal to) UDP. Because, w

on a retransmission queue and

received, the segment is deleted from the queue. If the acknowledgment is not

before the timer runs out, the segment is retransmitted. So even though a packet gets

errored or dropped that packet will be retransmitted in TCP, but UDP will n

such packets.

As per the theory given and the explanation provided in the above paragraph, we see in

Graph 2, that there is no packet loss in TCP but UDP has packet loss.

0

100

200

300

400

500

600

700

800

900

1000

Exp1

No

.of

pa

cke

t lo

st

Graph I, shows that the number of successful packets transmitted in TCP is

UDP. Because, when TCP transmits a packet containing data, it puts a copy

queue and starts a timer; when the acknowledgment for that d

received, the segment is deleted from the queue. If the acknowledgment is not

t, the segment is retransmitted. So even though a packet gets

or dropped that packet will be retransmitted in TCP, but UDP will n

per the theory given and the explanation provided in the above paragraph, we see in

there is no packet loss in TCP but UDP has packet loss.

Exp2 Exp3

Experiment list

TCP vs UDP

- 19 -

Graph I, shows that the number of successful packets transmitted in TCP is greater than

containing data, it puts a copy

starts a timer; when the acknowledgment for that data is

received, the segment is deleted from the queue. If the acknowledgment is not received

t, the segment is retransmitted. So even though a packet gets

or dropped that packet will be retransmitted in TCP, but UDP will not retransmit

per the theory given and the explanation provided in the above paragraph, we see in

TCP

UDP

NetSim Experiment Manual

Experiment 4

Objective:

Simulate the different types of internet

analyze the throughput.

Theory:

FTP is File Transfer Protocol that transfers the files from source to destination. It is an

application layer protocol. The file

TELNET is Terminal Network Protocol

machine. It is also an Application layer protocol. It establishes connection to the remote

machine over TCP.

Procedure:

How to Create Scenario & Generate Traffic:

o Create Scenario: “Help

Internetworks � Create Scenario”.

Sample Inputs:

FTP, Database, Voice and V

model other applications the “Custom” option

modeled in NetSim by using c

Time for TELNET application is

Distribution

Packet Size (Bytes)

Distribution

Packet Inter Arrival Time (m

Simulate the different types of internet traffic such as FTP, TELNET over a network and

is File Transfer Protocol that transfers the files from source to destination. It is an

plication layer protocol. The file transfer takes place over TCP.

l Network Protocol that is used to access the data in the remote

machine. It is also an Application layer protocol. It establishes connection to the remote

How to Create Scenario & Generate Traffic:

“Help � NetSim Help F1 � Running Simulation via GUI

Create Scenario”.

FTP, Database, Voice and Video are the traffic types available as options

cations the “Custom” option is available. TELNET application has been

by using custom traffic type. Packet Size and Packet I

application is shown below:

Packet Size

Distribution Constant

Size (Bytes) 1460

Packet Inter Arrival Time

Distribution Constant

Packet Inter Arrival Time (ms) 15000

- 20 -

traffic such as FTP, TELNET over a network and

is File Transfer Protocol that transfers the files from source to destination. It is an

to access the data in the remote

machine. It is also an Application layer protocol. It establishes connection to the remote

Running Simulation via GUI �

e the traffic types available as options in NetSim. To

TELNET application has been

ustom traffic type. Packet Size and Packet Inter Arrival

NetSim Experiment Manual

In this experiment, 3 Routers and 8 Wired Nodes

Simulation environment. Wired Nodes 1, 2 and 3 are connected to Router 1. Wired Nodes

5, 6, 7 and 8 are connected to Router 3. Wired Node 4 is connected to Router 2. Router 1

and Router 3 are connected to Router 2. The network scenario is shown in fig 1.

Then follow these steps:

Sample 1: FTP Application from

Sample 2: FTP Application from

from Wired Node 1 to Wired Node 6.

Sample 3: FTP Application from Wired Node 4 to Wired Node 5. TELNET Application

from Wired Node 1 to Wired Node 6. TELNET Application from Wired Node 2 to

Node 7.

Sample 4: FTP Application from Wired Node 4 to Wired Node 5. TELNET Application

from Wired Node 1 to Wired Node 6. TELNET Application from Wired

Node 7. TELNET Application from Wired Node 3 to Wired Node 8.

Inputs for the Sample experiment are given below:

Set the following properties for all wired links.

xperiment, 3 Routers and 8 Wired Nodes need to be clicked & dropped onto the

Wired Nodes 1, 2 and 3 are connected to Router 1. Wired Nodes

connected to Router 3. Wired Node 4 is connected to Router 2. Router 1

and Router 3 are connected to Router 2. The network scenario is shown in fig 1.

FTP Application from Wired Node 4 to Wired Node 5.

cation from Wired Node 4 to Wired Node 5. TELNET

from Wired Node 1 to Wired Node 6.

: FTP Application from Wired Node 4 to Wired Node 5. TELNET Application

from Wired Node 1 to Wired Node 6. TELNET Application from Wired Node 2 to

: FTP Application from Wired Node 4 to Wired Node 5. TELNET Application

from Wired Node 1 to Wired Node 6. TELNET Application from Wired Node 2 to Wired

Node 7. TELNET Application from Wired Node 3 to Wired Node 8.

Fig 1: The Network Scenario

Inputs for the Sample experiment are given below:

Set the following properties for all wired links.

TELNET

FTP

- 21 -

& dropped onto the

Wired Nodes 1, 2 and 3 are connected to Router 1. Wired Nodes

connected to Router 3. Wired Node 4 is connected to Router 2. Router 1

and Router 3 are connected to Router 2. The network scenario is shown in fig 1.

TELNET Application

: FTP Application from Wired Node 4 to Wired Node 5. TELNET Application

from Wired Node 1 to Wired Node 6. TELNET Application from Wired Node 2 to Wired

: FTP Application from Wired Node 4 to Wired Node 5. TELNET Application

Node 2 to Wired

NetSim Experiment Manual

Wired Node Properties:

Set the following properties for Wired Node X if a

is Wired Node Y. Set the following properties for Wired Node A if a

TELNET and destination is Wired Node B.

Node Properties

Destination

Traffic Type

Distribution

Size (Bytes)

Distribution

Inter Arrival Time

TCP

Router Properties: Accept default properties for

Wired Link Properties: Set the foll

Link Properties

Medium Type

Uplink Speed (Mbps)

Downlink Speed (Mbps)

Uplink BER

Downlink BER

Simulation Time - 100 Sec

Upon completion of the experiment “Save”

carried out in the “Analytics” section by using export to Excel

Set the following properties for Wired Node X if application type is FTP

Set the following properties for Wired Node A if application type is

Wired Node B.

Node Properties Wired Node X Wired Node A

Wired Node Y Wired Node B

FTP Custom (for TELNET)

Size

Constant Constant

10000000 1460

Inter Arrival Time

Constant Constant

Inter Arrival Time 10 sec 15000 ms

TCP Properties

Enable Enable

Accept default properties for the Router.

t the following properties for all Wired Links.

Link Properties All Wired Link

Medium Type CAT-5

peed (Mbps) 1

peed (Mbps) 1

No Error

BER No Error

Upon completion of the experiment “Save” the experiments for comparisons that can be

carried out in the “Analytics” section by using export to Excel.

- 22 -

and destination

pplication type is

Custom (for TELNET)

inks.

Links

for comparisons that can be

NetSim Experiment Manual

Output:Open the Excel Sheet

table below. These throughput values are available under application metrics in the

metrics screen of NetSim.

Experiment

Number

Source

1 Wired Node 4

2 Wired Node 4

2 Wired Node 1

3 Wired Node 4

3 Wired Node 1

3 Wired Node 2

4 Wired Node 4

4 Wired Node 1

4 Wired Node 2

4 Wired Node 3

Graph I

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1FTP

FT

P T

hro

ug

hp

ut

(Mb

ps)

Sheet and note down the various throughputs as shown in the

table below. These throughput values are available under application metrics in the

Destination Application Throughput

Wired Node 4 Wired Node 5 FTP 0.799846

Wired Node 4 Wired Node 5 FTP 0.464397

Wired Node 1 Wired Node 6 TELNET 0.487757

Wired Node 4 Wired Node 5 FTP 0.306483

Wired Node 1 Wired Node 6 TELNET 0.330778

Wired Node 2 Wired Node 7 TELNET 0.330778

Wired Node 4 Wired Node 5 FTP 0.228928

Wired Node 1 Wired Node 6 TELNET 0.245747

Wired Node 2 Wired Node 7 TELNET 0.246682

Wired Node 3 Wired Node 8 TELNET 0.242944

1FTP + 1 TELNET 1FTP + 2 TELNET 1FTP + 3 TELNET

Experiments

FTP Throughput

- 23 -

and note down the various throughputs as shown in the

table below. These throughput values are available under application metrics in the

Throughput

0.799846

0.464397

0.487757

0.306483

0.330778

0.330778

0.228928

0.245747

0.246682

0.242944

1FTP + 3 TELNET

NetSim Experiment Manual

Graph II

Inference

From Graph I it can be inferred that FTP

transmitting nodes of TELNET

All TELNET applications in this exper

TELNET traffic over wired link 5 increases the F

From Graph II it can be inferred that TELNET

the number of transmitting nodes of TELNET

wired node 1 flows through wired link 5. Other TELNET applic

link 5.

Hence as the overall TELNET traffic over wired link 5 increases

throughput of Wired Node 1 decreases.

0

0.1

0.2

0.3

0.4

0.5

0.6

1 FTP + 1 TELNETTE

LNE

T T

hro

ug

hp

ut

(Mb

ps)

o

f W

ire

d N

od

e 1

TELNET Throughput of Wired Node 1

From Graph I it can be inferred that FTP throughput decreases as the number

transmitting nodes of TELNET application increases. Wired link 5 is used for FTP traffic.

All TELNET applications in this experiment also used Wired Link 5. Hence as the

TELNET traffic over wired link 5 increases the FTP throughput decreases.

I it can be inferred that TELNET throughput of Wired Node 1

of transmitting nodes of TELNET application increases. TELNET traffic of

wired node 1 flows through wired link 5. Other TELNET applications also used the wired

Hence as the overall TELNET traffic over wired link 5 increases, the TELNET

throughput of Wired Node 1 decreases.

1 FTP + 1 TELNET 1 FTP + 2 TELNET 1 FTP + 3 TELNET

Experiments

TELNET Throughput of Wired Node 1

- 24 -

throughput decreases as the number of

Wired link 5 is used for FTP traffic.

ink 5. Hence as the

TP throughput decreases.

of Wired Node 1 decreases as

TELNET traffic of

ations also used the wired

the TELNET

1 FTP + 3 TELNET

TELNET Throughput of Wired Node 1

NetSim Experiment Manual

Experiment 5

Objective:

Simulate the transmission of ping messages over a network topology consisting

nodes and find the number of packets dropped due to congestion.

Theory:

Ping is a computer network administration utility used to test the reachability of a

an Internet Protocol (IP) network and to measure the

from the originating host to a destination computer. Ping operates by sending

Control Message Protocol (ICMP)

an ICMP response. In the process it measures the time from transmission to reception

(round-trip time) and records any

Congestion occurs when the amount of incoming traffic is more than what the network

can handle. In such cases, r

arrive after the buffer is filled

Procedure:

How to Create Scenario & Generate Traffic:

o Create Scenario: “Help

�Internetworks� Create Scenario”.

Sample Inputs:

FTP, Database, Voice and Video are the traffic types available as options in NetSim. To

model other applications the “Custom” option is available. Ping application has been

modeled in NetSim by using custom traffic type. Packet Size and Packet Inter Arriva

Time for Ping application is shown below:

Distribution

Packet Size (Bytes)

Distribution

Packet Inter Arrival Time (m

Simulate the transmission of ping messages over a network topology consisting

nodes and find the number of packets dropped due to congestion.

administration utility used to test the reachability of a

(IP) network and to measure the round-trip time for messages sent

from the originating host to a destination computer. Ping operates by sending

(ICMP) echo request packets to the target host and waiting for

an ICMP response. In the process it measures the time from transmission to reception

and records any packet loss.

Congestion occurs when the amount of incoming traffic is more than what the network

can handle. In such cases, routers store these packets in the buffer. All the packets that

after the buffer is filled are dropped.

to Create Scenario & Generate Traffic:

“Help �NetSim Help F1� Running Simulation via GUI

Create Scenario”.

FTP, Database, Voice and Video are the traffic types available as options in NetSim. To

model other applications the “Custom” option is available. Ping application has been

modeled in NetSim by using custom traffic type. Packet Size and Packet Inter Arriva

Time for Ping application is shown below:

Packet Size

Distribution Constant

Size (Bytes) 32

Packet Inter Arrival Time

Distribution Constant

Packet Inter Arrival Time (ms) 100000

- 25 -

Simulate the transmission of ping messages over a network topology consisting of 6

administration utility used to test the reachability of a host on

for messages sent

from the originating host to a destination computer. Ping operates by sending Internet

to the target host and waiting for

an ICMP response. In the process it measures the time from transmission to reception

Congestion occurs when the amount of incoming traffic is more than what the network

in the buffer. All the packets that

Running Simulation via GUI

FTP, Database, Voice and Video are the traffic types available as options in NetSim. To

model other applications the “Custom” option is available. Ping application has been

modeled in NetSim by using custom traffic type. Packet Size and Packet Inter Arrival

NetSim Experiment Manual

In this experiment, 1 Router and 6 Wired Nodes

Simulation environment. Wired Nodes are connected to Router as shown below.

Sample 1:

Wired Node Properties:

Node Properties

Destination

Traffic Type

Codec

Distribution

Packet Size (Bytes)

Distribution

Packet Inter Arrival

Time (ms)

Service Type

TCP

xperiment, 1 Router and 6 Wired Nodes need to be clicked& dropped onto the

Wired Nodes are connected to Router as shown below.

Node Properties Wired Node 1

(Application 1)

Wired Node 1

(Application 2)

Wired Node 6 Wired Node

Voice Custom

Constant ---

Packet Size

Constant Constant

Size (Bytes) 160 32

Packet Inter Arrival Time

Constant Constant

Packet Inter Arrival 10000 100000

CBR ---

TCP Properties

Disable Disable

- 26 -

& dropped onto the

Wired Nodes are connected to Router as shown below.

Wired Node 1

(Application 2)

Wired Node 6

NetSim Experiment Manual

Router Properties: Set buffer size to 8 MB. Set scheduling type of interface connected to

Wired Node 6 to FIFO.

Wired Link Properties:

Link Properties

Medium Type

Uplink Speed (Mbps)

Downlink S

(Mbps)

Uplink BER

Downlink BER

Sample 2:

Wired Node Properties:

Node Properties

Destination

Traffic Type

Codec

Distribution

Packet Size (Bytes)

Distribution

Packet Inter Arrival

Time (ms)

Service Type

TCP

Set buffer size to 8 MB. Set scheduling type of interface connected to

Link Properties Wired Link 1 Wired Link 6

T1 E0

(Mbps) 1.54 0.064

Downlink Speed 1.54 0.064

10-6

10-6

10-6

10-6

Node Properties Wired Node 1

(Application 1)

Wired Node 1

(Application 2)

Wired Node 6 Wired Node

Voice Custom

Constant ---

Packet Size

Constant Constant

Size (Bytes) 160 32

Packet Inter Arrival Time

Constant Constant

Packet Inter Arrival 10000 100000

CBR ---

TCP Properties

Disable Disable

- 27 -

Set buffer size to 8 MB. Set scheduling type of interface connected to

Wired Link 6

Wired Node 1

(Application 2)

Wired Node 6

NetSim Experiment Manual

Router Properties: Set buffer size to 8 MB. Set scheduling type of interface connected to

Wired Node 6 to Priority.

Wired Link Properties:

Link Properties

Medium Type

Uplink Speed (Mbps)

Downlink S

(Mbps)

Uplink BER

Downlink BER

Follow these steps to get remaining samples.

1. Add one more voice application to Sample 1 with source as Wired Node 2 and

destination as Wired Node 6.

Set the properties of

1.54, Downlink Speed (Mbps): 1.54, Uplink BER: 10

In router properties, set scheduling type of interface connected to Wired Node 6 to

FIFO and Priority to get Sample 3 and Sample 4 respectively.

2. Add one more voice application to Sample 3 with source as Wired Node 3 and

destination as Wired Node 6.

Set the properties of Wired

1.54, Downlink Speed (Mbps): 1.54, Uplink BER: 10

In router properties, set scheduling type of interface connected to Wired Node 6 to

FIFO and Priority to get Sample 5 and Sample 6 res

3. Similarly, add one more voice application to Sample 5 and set router and Wired

Link 4 properties to get Sample 7 and Sample 8.

4. Then add another voice application to Sample 7 and set properties to get Sample 9

and Sample 10.

Set buffer size to 8 MB. Set scheduling type of interface connected to

Link Properties Wired Link 1 Wired Link 6

T1 E0

peed (Mbps) 1.54 0.064

Downlink Speed 1.54 0.064

10-6

10-6

10-6

10-6

Follow these steps to get remaining samples.

Add one more voice application to Sample 1 with source as Wired Node 2 and

destination as Wired Node 6.

Set the properties of Wired Link 2 (Medium Type: T1, Uplink Speed (Mbps):

1.54, Downlink Speed (Mbps): 1.54, Uplink BER: 10-6

, Downlink

set scheduling type of interface connected to Wired Node 6 to

FIFO and Priority to get Sample 3 and Sample 4 respectively.

Add one more voice application to Sample 3 with source as Wired Node 3 and

destination as Wired Node 6.

Set the properties of Wired Link 3 (Medium Type: T1, Uplink Speed (Mbps):

1.54, Downlink Speed (Mbps): 1.54, Uplink BER: 10-6

, Downlink BER: 10

set scheduling type of interface connected to Wired Node 6 to

FIFO and Priority to get Sample 5 and Sample 6 respectively.

Similarly, add one more voice application to Sample 5 and set router and Wired

Link 4 properties to get Sample 7 and Sample 8.

Then add another voice application to Sample 7 and set properties to get Sample 9

- 28 -

Set buffer size to 8 MB. Set scheduling type of interface connected to

Wired Link 6

Add one more voice application to Sample 1 with source as Wired Node 2 and

Wired Link 2 (Medium Type: T1, Uplink Speed (Mbps):

, Downlink BER: 10-6

).

set scheduling type of interface connected to Wired Node 6 to

Add one more voice application to Sample 3 with source as Wired Node 3 and

Link 3 (Medium Type: T1, Uplink Speed (Mbps):

, Downlink BER: 10-6

).

set scheduling type of interface connected to Wired Node 6 to

Similarly, add one more voice application to Sample 5 and set router and Wired

Then add another voice application to Sample 7 and set properties to get Sample 9

NetSim Experiment Manual

Simulation Time - 100 Sec

(Note: The Simulation Time can be selected only after the following two tasks,

• Set the properties for the Wired Nodes, Router and Wired

• Click on the Simulate button

Upon completion of the experiment “Save”

carried out in the “Analytics” section by using export to Excel

Output:

Open the Excel Sheet and note down the number of packets dropped and number of ping

messages (Packets Received) received as shown in below table. These

available under queue metrics and application metrics in the metrics screen of NetSim.

Sample

Number

No. of voice

applications

1 1

2 1

3 2

4 2

5 3

6 3

7 4

8 4

9 5

10 5

The Simulation Time can be selected only after the following two tasks,

the properties for the Wired Nodes, Router and Wired Links.

Simulate button).

Upon completion of the experiment “Save” the experiments for comparisons that can be

carried out in the “Analytics” section by using export to Excel.

Open the Excel Sheet and note down the number of packets dropped and number of ping

messages (Packets Received) received as shown in below table. These

available under queue metrics and application metrics in the metrics screen of NetSim.

Scheduling type

Ping messages

received dropped packets

FIFO 359

Priority 0

FIFO 183

Priority 0

FIFO 123

Priority 0

FIFO 92

Priority 0

FIFO 74

Priority 0

- 29 -

The Simulation Time can be selected only after the following two tasks,

for comparisons that can be

Open the Excel Sheet and note down the number of packets dropped and number of ping

messages (Packets Received) received as shown in below table. These values are

available under queue metrics and application metrics in the metrics screen of NetSim.

Total no. of

dropped packets

0

0

0

0

0

0

0

0

7413

7409

NetSim Experiment Manual

Inference

From the table we can observe that number of ping messages received when scheduling

type is Priority is less than number of ping messages received when scheduling type is

FIFO. In NetSim, Voice messages have higher priority compared to ping messages.

Hence when scheduling type is Priority, higher preference is given to voice messages. As

a result, the number of ping messages received is lower when priority based scheduling is

considered.

From the table we can observe that packets are dropped when there are

applications. The number of packets that arrive at the router increases when there are

more number of voice applications. As a result the buffer gets filled. All the packets that

arrive after the buffer is filled will be dropped.

From the table we can observe that number of ping messages received when scheduling

type is Priority is less than number of ping messages received when scheduling type is

FIFO. In NetSim, Voice messages have higher priority compared to ping messages.

when scheduling type is Priority, higher preference is given to voice messages. As

a result, the number of ping messages received is lower when priority based scheduling is

From the table we can observe that packets are dropped when there are

applications. The number of packets that arrive at the router increases when there are

more number of voice applications. As a result the buffer gets filled. All the packets that

arrive after the buffer is filled will be dropped.

- 30 -

From the table we can observe that number of ping messages received when scheduling

type is Priority is less than number of ping messages received when scheduling type is

FIFO. In NetSim, Voice messages have higher priority compared to ping messages.

when scheduling type is Priority, higher preference is given to voice messages. As

a result, the number of ping messages received is lower when priority based scheduling is

From the table we can observe that packets are dropped when there are five voice

applications. The number of packets that arrive at the router increases when there are

more number of voice applications. As a result the buffer gets filled. All the packets that

NetSim Experiment Manual

Experiment 6

Objective:

Simulate an Ethernet LAN using n nodes (6

compare throughput.

Part A:

To simulate an Ethernet LAN using n nodes (6

throughput.

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.

BER=Bit errors/Total number of bits

For example, a transmission might have a BER of 10

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 f

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.

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.

Procedure:

How to Create Scenario & Generate Traffic:

o Create Scenario: “Help

Internetworks � Create Scenario”.

Click & drop Wired Nodes and Switches onto the Simulation Environment as shown

below.

imulate an Ethernet LAN using n nodes (6-10), change error rate and data rate and

To simulate an Ethernet LAN using n nodes (6-10), change error rate and compare

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.

BER=Bit errors/Total number of bits

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.

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.

How to Create Scenario & Generate Traffic:

“Help � NetSim Help F1 � Running Simulation via GUI

Create Scenario”.

Click & drop Wired Nodes and Switches onto the Simulation Environment as shown

- 31 -

10), change error rate and data rate and

10), change error rate and compare

error rate or bit error ratio is the number of bit errors divided by the total number

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

ull 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.

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.

Running Simulation via GUI �

Click & drop Wired Nodes and Switches onto the Simulation Environment as shown

NetSim Experiment Manual

Sample Inputs:

Upon completion of the experiment “Save”

carried out in the “Analytics” section by using export to Excel

Sample 1: Set the properties for the devices and links as shown below:

Wired Node Properties:

Wired Node Properties

Destination

Traffic Type

Distribution

Packet Size (Bytes)

Distribution

Packet Inter Arrival

Time (ms)

TCP

Upon completion of the experiment “Save” the experiments for comparisons that can be

carried out in the “Analytics” section by using export to Excel.

Set the properties for the devices and links as shown below:

Wired Node Properties Wired Node 1

Destination Wired Node 4

Traffic Type Custom

Packet Size

Distribution Constant

Packet Size (Bytes) 1460

Packet Inter Arrival Time

Distribution Constant

Packet Inter Arrival

Time (ms)

2500

TCP Properties

Disable

- 32 -

for comparisons that can be

NetSim Experiment Manual

Switch Properties:

Accept the default properties for

Wired Link Properties:

Wired Link Properties

Uplink Speed (Mbps)

Downlink Speed(Mbps)

Uplink BER

Downlink BER

Simulation Time - 100 Sec

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties for Wired Nodes , Switches, &Wired Links

• Then click on the Simulate button)

Sample 2: Set the properties for the devices and links as shown below:

Wired Node Properties:

Wired Node Properties

Destination

Traffic Type

Distribution

Packet Size (Bytes)

Distribution

Packet Inter Arrival

Time (ms)

TCP

Accept the default properties for Switches.

Wired Link Properties Link 1 Link 4 Link 5

Uplink Speed (Mbps) 10 10 10

Downlink Speed(Mbps) 10 10 10

No Error No Error No Error

No Error No Error No Error

The Simulation Time can be selected only after doing the following two tasks,

Set the properties for Wired Nodes , Switches, &Wired Links

Then click on the Simulate button).

Set the properties for the devices and links as shown below:

Wired Node Properties Wired Node 1

Destination Wired Node 4

Traffic Type Custom

Packet Size

Distribution Constant

Packet Size (Bytes) 1460

Packet Inter Arrival Time

Distribution Constant

Packet Inter Arrival

Time (ms)

2500

TCP Properties

Disable

- 33 -

5

No Error

No Error

The Simulation Time can be selected only after doing the following two tasks,

NetSim Experiment Manual

Switch Properties:

Accept the default properties for Switches.

Wired Link Properties:

Wired Link Properties

Uplink Speed (Mbps)

Downlink Speed(Mbps)

Uplink BER

Downlink BER

Simulation Time - 100 Sec

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties for Wired Nodes , Switches, &Wired Links

• Then click on the Simulate button)

Sample 1: Wired Node 1 transmits data to Wired Node 4 with Uplink BER and Downlink

BER as No Error

Sample 2: Wired Node 1 transmits data to Wired Node 4 with Uplink BER and Downlink

BER as 10-9

And so on do the Sample 3, Sample 4 and Sample 5 by

Downlink BER as 10-8,

10-7

and

Simulation Time - 100 Sec

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties for Wired Nodes , Switches, &Wired Links

• Then click on the Simulate button)

Upon completion of the experiment “Save”

carried out in the “Analytics” section by using export to Excel

Accept the default properties for Switches.

Wired Link Properties Link 1 Link 4 Link 5

Uplink Speed (Mbps) 10 10 10

Downlink Speed(Mbps) 10 10 10

10-9

10-9

10-9

10-9

10-9

10-9

The Simulation Time can be selected only after doing the following two tasks,

Set the properties for Wired Nodes , Switches, &Wired Links

Then click on the Simulate button).

Node 1 transmits data to Wired Node 4 with Uplink BER and Downlink

Node 1 transmits data to Wired Node 4 with Uplink BER and Downlink

And so on do the Sample 3, Sample 4 and Sample 5 by increasing the Uplink BER and

and 10-6

accordingly.

The Simulation Time can be selected only after doing the following two tasks,

Set the properties for Wired Nodes , Switches, &Wired Links

on the Simulate button).

Upon completion of the experiment “Save” the experiments for comparisons that can be

carried out in the “Analytics” section by using export to Excel.

- 34 -

5

The Simulation Time can be selected only after doing the following two tasks,

Node 1 transmits data to Wired Node 4 with Uplink BER and Downlink

Node 1 transmits data to Wired Node 4 with Uplink BER and Downlink

the Uplink BER and

The Simulation Time can be selected only after doing the following two tasks,

for comparisons that can be

NetSim Experiment Manual

Comparison Chart:

Graph I : Error Rate Vs Packets Error

Graph II : Error Rate Vs Throughput

Inference:

From Graph I, 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.

Obviously, errored packets are not delivered to the destination. And therefore

packets get errored throughput

4.4

4.45

4.5

4.55

4.6

4.65

4.7

No Error

Th

rou

gh

pu

t

ate Vs Packets Errored

Rate Vs Throughput

we see that as the error rate is increased the number of errored packets

The increase is exponential since the error rate is increased in powers of 10.

Obviously, errored packets are not delivered to the destination. And therefore

throughput decreases in Graph II.

No Error 10^-9 10^-8 10^-7 10^

Error Rate

Error Rate Vs Throughput

- 35 -

we see that as the error rate is increased the number of errored packets

The increase is exponential since the error rate is increased in powers of 10.

Obviously, errored packets are not delivered to the destination. And therefore when more

10^-6

NetSim Experiment Manual

Part B:

Objective:

To simulate an Ethernet LAN using n nodes (6

throughput.

Theory:

Data Rate:

Data Rate is the speed at which data can be transmitted from one device to another. It is

often measured in megabits (million bits) per second.

Procedure:

How to Create Scenario & Generate Traffic:

o Create Scenario: “Help

Internetworks � Create Scenario”.

Click & drop Wired Nodes and Switches onto the Simulation Environment as shown

below.

Sample Inputs:

Upon completion of the experiment “Save”

carried out in the “Analytics” section by using export to Excel

To simulate an Ethernet LAN using n nodes (6-10), change data rate and compare

Data Rate is the speed at which data can be transmitted from one device to another. It is

often measured in megabits (million bits) per second.

How to Create Scenario & Generate Traffic:

“Help � NetSim Help F1 � Running Simulation via GUI

Create Scenario”.

Click & drop Wired Nodes and Switches onto the Simulation Environment as shown

Upon completion of the experiment “Save” the experiments for comparisons that can be

carried out in the “Analytics” section by using export to Excel.

- 36 -

10), change data rate and compare

Data Rate is the speed at which data can be transmitted from one device to another. It is

Running Simulation via GUI �

Click & drop Wired Nodes and Switches onto the Simulation Environment as shown

for comparisons that can be

NetSim Experiment Manual

Sample 1:

Set the properties for the devices and links as shown below:

Wired Node Properties:

Wired Node Properties

Destination

Traffic Type

Distribution

Packet Size (Bytes)

Distribution

Packet Inter Arrival

Time (ms)

TCP

Switch Properties: Accept the default properties for

Wired Link Properties:

Wired Link Properties

Uplink Speed (Mbps)

Downlink Speed(Mbps)

Uplink BER

Downlink BER

Set the properties for the devices and links as shown below:

Wired Node Properties Wired Node 1

Destination Wired Node 4

Traffic Type Custom

Packet Size

Distribution Constant

Packet Size (Bytes) 10000

Packet Inter Arrival Time

Distribution Constant

Packet Inter Arrival

Time (ms)

1000

TCP Properties

Disable

Accept the default properties for Switches.

Wired Link Properties Link 1 Link 4 Link 5

Uplink Speed (Mbps) 20 20 20

Downlink Speed(Mbps) 20 20 20

No Error No Error No Error

No Error No Error No Error

- 37 -

5

No Error

No Error

NetSim Experiment Manual

Simulation Time - 10 Sec

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties for Wired Nodes , Switches, &Wired Links

• Then click on the Simulate button)

Sample 2:

Set the properties for the devices and links as shown below:

Wired Node Properties:

Wired Node Properties

Destination

Traffic Type

Distribution

Packet Size (Bytes)

Distribution

Packet Inter Arrival

Time (ms)

TCP

Switch Properties:

Accept the default properties for Switches.

The Simulation Time can be selected only after doing the following two tasks,

Set the properties for Wired Nodes , Switches, &Wired Links

Then click on the Simulate button).

Set the properties for the devices and links as shown below:

Wired Node Properties Wired Node 1

Destination Wired Node 4

Traffic Type Custom

Packet Size

Distribution Constant

Packet Size (Bytes) 10000

Packet Inter Arrival Time

Distribution Constant

Packet Inter Arrival

Time (ms)

1000

TCP Properties

Disable

Accept the default properties for Switches.

- 38 -

The Simulation Time can be selected only after doing the following two tasks,

NetSim Experiment Manual

Wired Link Properties:

Wired Link Properties

Uplink Speed (Mbps)

Downlink Speed(Mbps)

Uplink BER

Downlink BER

Simulation Time - 10 Sec

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties for Wired Nodes , Switches, &Wired Links

• Then click on the Simulate

Sample 1: Wired Node 1 transmits data to Wired Node 4 with Uplink Speed (Mbps) and

Downlink Speed (Mbps) as 20

Sample 2: Wired Node 1 transmits data to Wired Node 4 with Uplink Speed (Mbps) and

Downlink Speed (Mbps) as 40

And so on do the Sample 3 and Sample 4

Downlink Speed (Mbps) as 60 and 80

Simulation Time - 10 Sec

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties for Wired

• Then click on the Simulate button)

Wired Link Properties Link 1 Link 4 Link 5

Uplink Speed (Mbps) 40 40 40

Downlink Speed(Mbps) 40 40 40

No Error No Error No Error

No Error No Error No Error

The Simulation Time can be selected only after doing the following two tasks,

Set the properties for Wired Nodes , Switches, &Wired Links

Then click on the Simulate button).

Node 1 transmits data to Wired Node 4 with Uplink Speed (Mbps) and

20

Node 1 transmits data to Wired Node 4 with Uplink Speed (Mbps) and

40

Sample 3 and Sample 4 by increasing the Uplink Speed (Mbps) and

60 and 80 accordingly.

The Simulation Time can be selected only after doing the following two tasks,

Set the properties for Wired Nodes , Switches, &Wired Links

Then click on the Simulate button).

- 39 -

5

Error

No Error

The Simulation Time can be selected only after doing the following two tasks,

Node 1 transmits data to Wired Node 4 with Uplink Speed (Mbps) and

Node 1 transmits data to Wired Node 4 with Uplink Speed (Mbps) and

by increasing the Uplink Speed (Mbps) and

The Simulation Time can be selected only after doing the following two tasks,

NetSim Experiment Manual

Comparison Chart:

Graph I

Data Rate Vs Throughput

Inference:

The number of packets transmitted

So when link is forwarding

destination is more. Because of this throughput linearly increases when

speed) increases in Graph I.

0

10

20

30

40

50

60

70

80

20

Th

rou

gh

pu

t

transmitted to the destination is based on the network link

forwarding more packets, the number of packets transmitted to the

destination is more. Because of this throughput linearly increases when

40 60

Data Rate

Data Rate Vs Throughput

- 40 -

the destination is based on the network link’s speed.

packets transmitted to the

destination is more. Because of this throughput linearly increases when data rate (link

80

NetSim Experiment Manual

Experiment 7

Objective:

To Simulate an Ethernet LAN using n nodes and set

collision across different nodes.

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.

Procedure:

How to Create Scenario & Generate Traffic:

o Create Scenario: “Help

Legacy Networks � Create Scenario”.

Drag & drop Hub and Wired Nodes

Sample Input:

Set the properties for the devices as shown below:

To Simulate an Ethernet LAN using n nodes and set multiple traffic nodes and determine

collision across different nodes.

Carrier Sense Multiple Access Collision Detection (CSMA / CD)

This protocol includes the improvements for stations to abort their transmissions as soon

n. 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

wer 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

ng in the meantime.

How to Create Scenario & Generate Traffic:

“Help � NetSim Help F1 � Running Simulation via GUI

Create Scenario”.

and Wired Nodes onto the Simulation Environment as shown

Set the properties for the devices as shown below:

- 41 -

multiple traffic nodes and determine

This protocol includes the improvements for stations to abort their transmissions as soon

n. 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

wer 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

Running Simulation via GUI �

onto the Simulation Environment as shown below.

NetSim Experiment Manual

Wired Node Properties:

Hub Properties:

Hub Properties

Data Rate(Mbps)

Error Rate (bit error rate)

Physical Medium

Simulation Time - 10 Seconds

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties of Wired

• Then click on the Simulate butto

Wired Node

Properties

NODE 1

Transmission Point to

Point

Destination Node 2

Traffic Type Data

Distribution Constant

Application

Data Size

(Bytes)

1472

Distribution Constant

Inter Arrival

Time

1000

Hub Properties Values to be Selected

Data Rate(Mbps) 10

Error Rate (bit error rate) No error

Physical Medium Twisted Pair

10 Seconds

The Simulation Time can be selected only after doing the following two tasks,

Wired Nodes and Hub

Simulate button).

NODE 1 NODE 2 NODE 3 NODE 4

Point to

Point to

Point

Point to

Point

Point to

Point

2 Node 3 Node 4 Node 5

Data Data Data

Application Data Size

Constant Constant Constant Constant

1472 1472 1472

Inter Arrival Time

Constant Constant Constant Constant

1000 1000 1000

- 42 -

The Simulation Time can be selected only after doing the following two tasks,

NODE 5

Point to

Point

Node 1

Data

Constant

1472

Constant

1000

NetSim Experiment Manual

Output:

Collision Determination:

• Once the simulation is completed “

temp path of the operating system. To re

then type %temp%/NetSim

• Open the file in Excel. (Note

Packet Trace � How to import Packet Trace to

In Excel go to Data and select

And then click on the “Source_

the “Collision_Count” for the particular source together as shown in the figure.

completed “CollisionCount.txt” file will be written in the

temp path of the operating system. To reach the temp folder Click Start

%temp%/NetSim

Note: Please refer, Help � NetSim Help F1 �

How to import Packet Trace to Excel?)

and select Filter option then filter will be applied to all columns.

ource_ID” Filter and select “Sort Smallest to Largest

” for the particular source together as shown in the figure.

- 43 -

be written in the

folder Click Start � Run and

� Generating

then filter will be applied to all columns.

Sort Smallest to Largest” to view

” for the particular source together as shown in the figure.

NetSim Experiment Manual

Comparison Table:

If collision occurs, the entry will be added in the table by incrementing the “

_Count” field value by 1. So the last entry of the particular “

“Total Collision_Count”. Likewise

as shown below.

Source_ID

1

2

3

4

5

Inference:

As expected we see a large number of collisions

number of collided packets in each node is approximately the same showing the inherent

“fairness” of CSMA / CD.

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.

If collision occurs, the entry will be added in the table by incrementing the “

by 1. So the last entry of the particular “Source_ID” will consist of

”. Likewise note down the Collision_Count for all

Source_ID Collision_Count

1 1146

2 1175

3 1188

4 1179

5 1184

As expected we see a large number of collisions in each node. Further, we notice that the

number of collided packets in each node is approximately the same showing the inherent

Performance studies indicate that CSMA/CD performs better at light network loads. With

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

ve 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

. These retransmitted packets also collided with the newly arriving packets.

- 44 -

If collision occurs, the entry will be added in the table by incrementing the “Collision

” will consist of

for all the Sources

in each node. Further, we notice that the

number of collided packets in each node is approximately the same showing the inherent

Performance studies indicate that CSMA/CD performs better at light network loads. With

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

ve 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

. These retransmitted packets also collided with the newly arriving packets.

NetSim Experiment Manual

Experiment 8

Objective:

To Simulate an Ethernet LAN using n nodes and set multiple traffic nodes and plot

contention window for different source/destination.

Theory:

Carrier Sense Multiple Acc

truncated binary back off algorithm

In Ethernet networks, the CSMA/CD is commonly used to schedule retransmissions after

collisions. The retransmission is delayed by an amount of

time and the number of attempts to retransmi

After c collisions, a random number of slot times between 0 and 2

first collision, each sender will wait 0 or 1 slot times. After the second collision, the

senders will wait anywhere from 0 to 3 slot times (

senders will wait anywhere from 0 to 7 slot times (inclusive), and so forth. As the number

of retransmission attempts increases, the number o

exponentially.

The 'truncated' simply means that after a certain number of increases, the exponentiation

stops; i.e. the retransmission timeout reaches a ceiling, and thereafter does not increase

any further. For example, if the ceiling is set at

CSMA/CD standard), then the maximum de

Because these delays cause other stations that are sending to collide as well, there is a

possibility that, on a busy network, hundreds of people may be caught in a single collision

set. Because of this possibility, after 16 attempt

Procedure:

How to Create Scenario & Generate Traffic:

o Create Scenario: “Help

Internetworks � Create Scenario”.

Drag & drop Hub and Wired Nodes

To Simulate an Ethernet LAN using n nodes and set multiple traffic nodes and plot

contention window for different source/destination.

Sense Multiple Access Collision Detection (CSMA/CD) - Working of the

truncated binary back off algorithm

networks, the CSMA/CD is commonly used to schedule retransmissions after

collisions. The retransmission is delayed by an amount of time derived from the

and the number of attempts to retransmit.

collisions, a random number of slot times between 0 and 2c - 1 is chosen. For the

first collision, each sender will wait 0 or 1 slot times. After the second collision, the

senders will wait anywhere from 0 to 3 slot times (inclusive). After the third collision, the

senders will wait anywhere from 0 to 7 slot times (inclusive), and so forth. As the number

of retransmission attempts increases, the number of possibilities for delay

The 'truncated' simply means that after a certain number of increases, the exponentiation

n timeout reaches a ceiling, and thereafter does not increase

any further. For example, if the ceiling is set at i = 10 (as it is in the IEEE 802.3

standard), then the maximum delay is 1023 slot times.

Because these delays cause other stations that are sending to collide as well, there is a

possibility that, on a busy network, hundreds of people may be caught in a single collision

set. Because of this possibility, after 16 attempts at transmission, the process is aborted.

How to Create Scenario & Generate Traffic:

“Help � NetSim Help F1 � Running Simulation via GUI

Create Scenario”.

and Wired Nodes onto the Simulation Environment as shown

- 45 -

To Simulate an Ethernet LAN using n nodes and set multiple traffic nodes and plot

Working of the

networks, the CSMA/CD is commonly used to schedule retransmissions after

derived from the slot

1 is chosen. For the

first collision, each sender will wait 0 or 1 slot times. After the second collision, the

). After the third collision, the

senders will wait anywhere from 0 to 7 slot times (inclusive), and so forth. As the number

f possibilities for delay increases

The 'truncated' simply means that after a certain number of increases, the exponentiation

n timeout reaches a ceiling, and thereafter does not increase

IEEE 802.3

Because these delays cause other stations that are sending to collide as well, there is a

possibility that, on a busy network, hundreds of people may be caught in a single collision

s at transmission, the process is aborted.

Running Simulation via GUI �

Environment as shown below.

NetSim Experiment Manual

Sample Input:

Set properties for the devices as shown below:

Wired Node Properties:

Hub Properties:

Hub Properties

Data Rate(Mbps)

Error Rate (bit error rate)

Physical Medium

Wired Node

Properties

Transmission

Destination

Traffic Type

Distribution

Application Data

Size (Bytes)

Distribution

Inter Arrival Time

Set properties for the devices as shown below:

Hub Properties Values to be Selected

Rate(Mbps) 10

Error Rate (bit error rate) No error

Physical Medium Twisted Pair

Node

NODE 1 NODE 4

Transmission Point to Point Point to Point

Destination Node 2 Node 1

Traffic Type Data Data

Application Data Size

Distribution Constant Constant

Application Data

(Bytes)

1472 1472

Inter Arrival Time

Distribution Constant Constant

Inter Arrival Time 2000 2000

- 46 -

NetSim Experiment Manual

Simulation Time - 10 Seconds

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties of Wired

• Then click on the Simulate butto

Output:

• Once the simulation is completed “

temp path of the operating system. To reach the temp folder Click Start

then type %temp%/NetSim

• Open the file in Excel. (Note:

Packet Trace�How to import Packet Trace to Excel?)

In Excel go to Data and select

And then click on the “Source_

the “Contention_Window” for the particular source together as shown in the figure.

10 Seconds

The Simulation Time can be selected only after doing the following two tasks,

Wired Nodes and Hub

Simulate button).

Once the simulation is completed “ContentionWindow.txt” file will be written in the

temp path of the operating system. To reach the temp folder Click Start

%temp%/NetSim

Note: Please refer, Help � NetSim Help F1 �

How to import Packet Trace to Excel?)

and select Filter option then filter will be applied to all columns.

Source_ID” Filter and select “Sort Smallest to Largest

” for the particular source together as shown in the figure.

- 47 -

The Simulation Time can be selected only after doing the following two tasks,

” file will be written in the

temp path of the operating system. To reach the temp folder Click Start � Run and

�Generating

then filter will be applied to all columns.

Sort Smallest to Largest” to view

” for the particular source together as shown in the figure.

NetSim Experiment Manual

Comparison Chart:

Graph I

(Note: These charts are plotted only for

Time vs. Contention Window Size

0

200

400

600

800

1000

1200

20

35

49

93

6

21

76

96

41

78

37

73

48

01

98

27

72

Co

nte

nti

on

Win

do

w S

ize

Time Vs. Contention Window Size

These charts are plotted only for Source_ID 1)

Time vs. Contention Window Size

98

27

72

13

61

09

8

17

97

15

1

21

04

06

3

24

02

51

6

27

31

78

0

31

62

96

2

36

70

63

0

40

46

24

0

43

86

33

6

46

71

16

8

49

74

44

0

53

57

53

4

58

23

23

6

62

45

64

6

66

14

06

0

69

81

36

4

74

75

31

8

Time(micro sec)

Time Vs. Contention Window Size

- 48 -

74

75

31

8

80

39

53

7

84

40

06

2

88

81

21

3

92

91

50

3

97

18

86

4

NetSim Experiment Manual

Graph II

(Note: This graph is plotted

Time vs. Contention Window Size

Inference:

As explained above in the theory part, whenever

size is calculated and a random number

nodes, the contention for the medium increases, causing more collisions and more

retransmission attempts. Hence the average contention window increases.

From the above graph it can be observed that

size increases, and at any time the maximum contention window size is 1023 (2

maximum retry limit for a packet is 16, after

0

200

400

600

800

1000

1200

20

35

10

67

2

22

18

1

46

99

2

71

01

0

11

06

90

Co

nte

nti

on

Win

do

w S

ize

Time Vs. Contention Window Size

This graph is plotted for the first 200 collisions)

Time vs. Contention Window Size

theory part, whenever a collision occurs the content

random number is generated. With more number of transmitting

nodes, the contention for the medium increases, causing more collisions and more

. Hence the average contention window increases.

From the above graph it can be observed that, for each collision the contention window

at any time the maximum contention window size is 1023 (2

maximum retry limit for a packet is 16, after which the packet is dropped.

11

06

90

12

58

90

21

75

23

22

68

27

33

07

18

40

87

73

42

15

63

55

74

65

62

94

01

64

70

10

73

87

35

76

00

87

97

22

54

98

14

55

10

95

08

7

11

69

39

8Time(micro sec)

Time Vs. Contention Window Size

- 49 -

the contention window

more number of transmitting

nodes, the contention for the medium increases, causing more collisions and more

. Hence the average contention window increases.

collision the contention window

at any time the maximum contention window size is 1023 (210

-1). The

dropped.

11

69

39

8

12

75

75

0

13

66

14

2

15

15

45

5

15

84

94

6

NetSim Experiment Manual

Experiment 9

Objective:

To simulate simple ESS and

determine the performance with respect to transmission of packets.

Theory:

Wireless LAN is basically a LAN that transmits data over air, without any physical

connection between devices. The transmission medium is a form of electromagnetic

radiation. Wireless LAN is ratified by IEEE in the IEEE 802.11 standard.

WLAN products on the market based on the IEEE 802.11b technology the transmitter is

designed as a Direct Sequence

modulator, which is capable of handling data rates of up to 11 Mbps.

algorithm used in Wireless LAN is known as the CSMA/CA

Access/Collision Avoidance algorithm.

Procedure:

How to Create Scenario & Generate Traffic:

o Create Scenario: “Help

Internetworks � Create Scenario”.

Click & drop Switch, Access Points and Wireless Nodes onto the Simulation

Environment as shown below.

To simulate simple ESS and with transmitting nodes in wireless LAN by simulation and

determine the performance with respect to transmission of packets.

Wireless LAN is basically a LAN that transmits data over air, without any physical

connection between devices. The transmission medium is a form of electromagnetic

radiation. Wireless LAN is ratified by IEEE in the IEEE 802.11 standard.

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 underlying

n Wireless LAN is known as the CSMA/CA – Carrier Sense Multiple

Access/Collision Avoidance algorithm.

How to Create Scenario & Generate Traffic:

“Help � NetSim Help F1 � Running Simulation via GUI

Create Scenario”.

Click & drop Switch, Access Points and Wireless Nodes onto the Simulation

Environment as shown below.

- 50 -

with transmitting nodes in wireless LAN by simulation and

Wireless LAN is basically a LAN that transmits data over air, without any physical

connection between devices. The transmission medium is a form of electromagnetic

radiation. Wireless LAN is ratified by IEEE in the IEEE 802.11 standard. In most of the

products on the market based on the IEEE 802.11b technology the transmitter is

Spectrum Phase Shift Keying (DSSS PSK)

The underlying

Carrier Sense Multiple

Running Simulation via GUI �

Click & drop Switch, Access Points and Wireless Nodes onto the Simulation

NetSim Experiment Manual

Sample Inputs:

Sample 1:

Set the properties for the devices and links as shown below:

Wireless Node Properties:

Wireless Node

Properties

Destination

Traffic Type

Distribution

Packet Size (Bytes)

Distribution

Packet Inter Arrival

Time (ms)

TCP

AP Properties: Accept the default properties for APs.

Switch Properties: Accept the default properties for Switches.

Link Properties: Accept the default properties for Wired and Wireless Links.

Simulation Time - 10 Sec

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties for Switch, Wireless Nodes ,Access points &Wired/Wireless

Links

• Then click on the Simulate button)

Set the properties for the devices and links as shown below:

Wireless Node

Properties

Wireless Node 1

Destination Wireless Node 4

Traffic Type Custom

Packet Size

Distribution Constant

Packet Size (Bytes) 1460

Packet Inter Arrival Time

Distribution Constant

Packet Inter Arrival

Time (ms)

2336

TCP Properties

Disable

Accept the default properties for APs.

Accept the default properties for Switches.

Accept the default properties for Wired and Wireless Links.

The Simulation Time can be selected only after doing the following two tasks,

rties for Switch, Wireless Nodes ,Access points &Wired/Wireless

Then click on the Simulate button).

- 51 -

Accept the default properties for Wired and Wireless Links.

The Simulation Time can be selected only after doing the following two tasks,

rties for Switch, Wireless Nodes ,Access points &Wired/Wireless

NetSim Experiment Manual

Sample 2:

Set the properties for the devices and links

Wireless Node Properties:

Wireless Node

Properties

Destination

Traffic Type

Distribution

Packet Size (Bytes)

Distribution

Packet Inter

Arrival Time (ms)

TCP

AP Properties: Accept the default properties for APs.

Switch Properties: Accept the default properties for Switches.

Link Properties: Accept the default properties for Wired and Wireless Links.

Simulation Time - 10 Sec

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties for

Links

• Then click on the Simulate button)

Set the properties for the devices and links as shown below:

Wireless Node

Properties

Wireless

Node 1

Wireless

Node 2

Destination Wireless

Node 4

Wireless

Node 5

Traffic Type Custom Custom

Packet Size

Distribution Constant Constant

Packet Size (Bytes) 1460 1460

Packet Inter Arrival Time

Distribution Constant Constant

Packet Inter

Arrival Time (ms)

2336 2336

TCP Properties

Disable Disable

Accept the default properties for APs.

Accept the default properties for Switches.

Accept the default properties for Wired and Wireless Links.

The Simulation Time can be selected only after doing the following two tasks,

Set the properties for Switch, Wireless Nodes ,Access points &Wired/Wireless

Then click on the Simulate button).

- 52 -

Accept the default properties for Wired and Wireless Links.

The Simulation Time can be selected only after doing the following two tasks,

Wired/Wireless

NetSim Experiment Manual

Sample 3:

Set the properties for the devices and links as shown below:

Wireless Node Properties:

Wireless Node

Properties

Destination

Traffic Type

Distribution

Packet Size (Bytes)

Distribution

Packet Inter

Arrival Time (ms)

TCP

AP Properties: Accept the default properties for APs.

Switch Properties: Accept the default properties for Switches.

Link Properties: Accept the default properties for Wired and

Simulation Time - 10 Sec

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties for

Links

• Then click on the Simulate button)

Set the properties for the devices and links as shown below:

Wireless Node Wireless

Node 1

Wireless

Node 2

Wireless

Node 3

Wireless

Node 4

Wireless

Node 5

Wireless

Node 6

Custom Custom Custom

Packet Size

Constant Constant Constant

Packet Size (Bytes) 1460 1460 1460

Packet Inter Arrival Time

Constant Constant Constant

Time (ms)

2336 2336 2336

TCP Properties

Disable Disable Disable

Accept the default properties for APs.

Accept the default properties for Switches.

Accept the default properties for Wired and Wireless Links.

The Simulation Time can be selected only after doing the following two tasks,

Set the properties for Switch, Wireless Nodes ,Access points &Wired/Wireless

Then click on the Simulate button).

- 53 -

Wireless

Wireless

Custom

Constant

Constant

Disable

Wireless Links.

The Simulation Time can be selected only after doing the following two tasks,

Switch, Wireless Nodes ,Access points &Wired/Wireless

NetSim Experiment Manual

Sample 4:

Set the properties for the devices and links as shown below:

Wireless Node Properties:

Wireless Node

Properties

Destination

Traffic Type

Distribution

Packet Size (Bytes)

Distribution

Packet Inter

Arrival Time (ms)

TCP

AP Properties: Accept the default properties for APs.

Switch Properties: Accept the default properties for Switches.

Link Properties: Accept the default properties for

Simulation Time - 10 Sec

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties for

Links

• Then click on the Simulate

Sample 5:

Set the properties for the devices and links as shown below:

Set the properties for the devices and links as shown below:

Wireless

Node 1

Wireless

Node 2

Wireless

Node 3

Wireless

Node 4

Wireless

Node 4

Wireless

Node 5

Wireless

Node 6

Wireless

Node 3

Custom Custom Custom Custom

Packet Size

Constant Constant Constant Constant

1460 1460 1460 1460

Packet Inter Arrival Time

Constant Constant Constant Constant

2336 2336 2336 2336

TCP Properties

Disable Disable Disable Disable

Accept the default properties for APs.

Accept the default properties for Switches.

Accept the default properties for Wired and Wireless Links.

The Simulation Time can be selected only after doing the following two tasks,

Set the properties for Switch, Wireless Nodes ,Access points &Wired/Wireless

Then click on the Simulate button).

Set the properties for the devices and links as shown below:

- 54 -

Wireless

Node 4

Wireless

Node 3

Custom

Constant

1460

Constant

2336

Disable

Wired and Wireless Links.

The Simulation Time can be selected only after doing the following two tasks,

Switch, Wireless Nodes ,Access points &Wired/Wireless

NetSim Experiment Manual

Wireless Node Properties:

Wireless Node

Properties

Wireless

Node 1

Destination Wireless

Node 4

Traffic Type Custom

Distribution Constant

Packet Size (Bytes) 1460

Distribution Constant

Packet Inter

Arrival Time (ms)

2336

TCP Disable

AP Properties: Accept the default properties for APs.

Switch Properties: Accept the

Link Properties: Accept the default properties for Wired and Wireless Links.

Simulation Time - 10 Sec

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties for

Links

• Then click on the Simulate button)

Sample 6:

Set the properties for the devices and links as shown below:

Wireless

Node 1

Wireless

Node 2

Wireless

Node 3

Wireless

Node 4

Wireless

Node 4

Wireless

Node 5

Wireless

Node 6

Wireless

Node 3

Custom Custom Custom Custom

Packet Size

Constant Constant Constant Constant

1460 1460 1460

Packet Inter Arrival Time

Constant Constant Constant Constant

2336 2336 2336

TCP Properties

Disable Disable Disable Disable

Accept the default properties for APs.

Accept the default properties for Switches.

Accept the default properties for Wired and Wireless Links.

The Simulation Time can be selected only after doing the following two tasks,

Set the properties for Switch, Wireless Nodes ,Access points &Wired/Wireless

Then click on the Simulate button).

Set the properties for the devices and links as shown below:

- 55 -

Wireless

Node 4

Wireless

Node 5

Wireless

Node 3

Wireless

Node 2

Custom Custom

Constant Constant

1460

Constant Constant

2336

Disable Disable

Accept the default properties for Wired and Wireless Links.

The Simulation Time can be selected only after doing the following two tasks,

Switch, Wireless Nodes ,Access points &Wired/Wireless

NetSim Experiment Manual

Wireless Node Properties:

Wireless

Node

Properties

Wireless

Node 1

Destination Wireless

Node 4

Traffic Type Custom

Distribution Constant

Packet Size

(Bytes)

1460

Distribution Constant

Packet Inter

Arrival Time

2336

TCP Disable

AP Properties: Accept the default properties for APs.

Switch Properties: Accept the default properties for Switches.

Link Properties: Accept the default properties for Wired and

Simulation Time - 10 Sec

(Note: The Simulation Time can be selected only after doing the following two tasks,

• Set the properties for

Links

• Then click on the Simulate button)

Wireless

Node 2

Wireless

Node 3

Wireless

Node 4

Wireless

Node 5

Wireless

Node 5

Wireless

Node 6

Wireless

Node 3

Wireless

Node 2

Custom Custom Custom Custom

Packet Size

Constant Constant Constant Constant

1460 1460 1460 1460

Packet Inter Arrival Time

Constant Constant Constant Constant

2336 2336 2336 2336

TCP Properties

Disable Disable Disable Disable

Accept the default properties for APs.

Accept the default properties for Switches.

Accept the default properties for Wired and Wireless Links.

The Simulation Time can be selected only after doing the following two tasks,

Set the properties for Switch, Wireless Nodes ,Access points &Wired/Wireless

Then click on the Simulate button).

- 56 -

Wireless

Node 5

Wireless

Node 6

Wireless

Node 2

Wireless

Node 1

Custom Custom

Constant Constant

1460

Constant Constant

2336

Disable Disable

Wireless Links.

The Simulation Time can be selected only after doing the following two tasks,

Switch, Wireless Nodes ,Access points &Wired/Wireless

NetSim Experiment Manual

Comparison Chart:

Graph I: Number of nodes generating traffic Vs Packets transmitted

Graph II: Throughput of a single Node vs. Number of transmitting nodes

0

1

2

3

4

5

6

1

Th

rou

gh

pu

t o

f N

od

e #

1

Throughput of a single Node Vs Number of

Number of nodes generating traffic Vs Packets transmitted

Throughput of a single Node vs. Number of transmitting nodes

2 3 4 5

Number of transmitting nodes

Throughput of a single Node Vs Number of

transmitting nodes

- 57 -

Throughput of a single Node vs. Number of transmitting nodes

6

NetSim Experiment Manual

Inference:

If the number of nodes generating

in the network also increases

transmitted when the transmitting nodes increases

accessing the medium at the same time

completion of packet transmission in the medium

when number of transmitting nodes increases

generating data increases then the number of packets

also increases. Hence there is a gradual increase in number of packets

transmitted when the transmitting nodes increases in Graph I.If more than one node

the medium at the same time, the particular node has to wait until

transmission in the medium. Hence Node #1’s throughput decrease

when number of transmitting nodes increases in Graph II.

- 58 -

the number of packets transmitted

gradual increase in number of packets

If more than one node is

to wait until the

throughput decreases

NetSim Experiment Manual

How to De-bug your code linked to NetSim’s Programming Exercise

In NetSim, programming exercise menu, users can write and link their code as

executables (*.exe). If the user’s *.exe file does not provide the correct output, NetSim UI

will display the message “Error in User Code”. To de

message, follow the steps given below:

1. Run the scenario again in sample mode. On completion, minimize NetSim and

keep it running without closing the programming exercise.

2. Open your code in Visual studio 2005 (or in Eclipse development environment).

This is how your code

(Refer visual studio help on how to create a Win 32 based Exe project)

3. Right click on your project and select properties as shown below

4. Inside the properties window select Debugging and edit the

as shown

bug your code linked to NetSim’s Programming Exercise

programming exercise menu, users can write and link their code as

executables (*.exe). If the user’s *.exe file does not provide the correct output, NetSim UI

will display the message “Error in User Code”. To de-bug your code on getting this

w the steps given below:

Run the scenario again in sample mode. On completion, minimize NetSim and

keep it running without closing the programming exercise.

Open your code in Visual studio 2005 (or in Eclipse development environment).

This is how your code should look when opened in Visual studio as a project

(Refer visual studio help on how to create a Win 32 based Exe project)

Right click on your project and select properties as shown below

Inside the properties window select Debugging and edit the Command Arguments

- 59 -

bug your code linked to NetSim’s Programming Exercise

programming exercise menu, users can write and link their code as

executables (*.exe). If the user’s *.exe file does not provide the correct output, NetSim UI

bug your code on getting this

Run the scenario again in sample mode. On completion, minimize NetSim and

Open your code in Visual studio 2005 (or in Eclipse development environment).

should look when opened in Visual studio as a project

(Refer visual studio help on how to create a Win 32 based Exe project)

Command Arguments

NetSim Experiment Manual

5. Inside command argument add the following two paths

a. Path to where NetSim is in

C:\Program Files

the NetSim icon and selecti

b. The windows temporary path which has the NetSim folder for temporary

data. This can be got by Start

c. On clicking this, you will get a path similar to C:

Settings\George

should also be in double quotes “ ”

between the first path and the second path. For example: "C:

Files\NetSim_Standard_SW_7

Settings\George

6. Now add a breakpoint to your code in your function or in the main ( ), and

proceed with de-bugging

7. At the end check if the output.txt present in the %temp%

temp.txt present in the %temp%

would indicate that your code will work fine when you run it in use

next time.

Inside command argument add the following two paths

Path to where NetSim is installed within double quotes “ ”

Program Files\NetSim Standard. This can be got by right clicking on

the NetSim icon and selecting Find target or open file location.

The windows temporary path which has the NetSim folder for temporary

data. This can be got by Start->Run and typing %temp%/NetSim

On clicking this, you will get a path similar to C:\Documents and

George\Local Settings\Temp\NetSim. As mentioned above, this

uld also be in double quotes “ ”, and there should be a single space

between the first path and the second path. For example: "C:

NetSim_Standard_SW_7.0" "C:\Documents and

George\Local Settings\Temp\NetSim

Now add a breakpoint to your code in your function or in the main ( ), and

bugging

At the end check if the output.txt present in the %temp%\NetSim path and the

temp.txt present in the %temp%\NetSim path are exactly similar. Exact similarity

would indicate that your code will work fine when you run it in use

- 60 -

stalled within double quotes “ ”. This is usually

NetSim Standard. This can be got by right clicking on

ng Find target or open file location.

The windows temporary path which has the NetSim folder for temporary

>Run and typing %temp%/NetSim

Documents and

NetSim. As mentioned above, this

, and there should be a single space

between the first path and the second path. For example: "C:\Program

Now add a breakpoint to your code in your function or in the main ( ), and

NetSim path and the

similar. Exact similarity

would indicate that your code will work fine when you run it in user mode the

NetSim Experiment Manual

Experiment 10 - Cyclic Redundancy Check

Objective: Write a program for error detecting code using CRC

(Note: CRC 12, CRC 16 and CRC 32

Theory:

Cyclic redundancy check (CRC) is a type of function that takes a data stream of any

length as input, and produces an output. Bit strings are treated as representation of

polynomials with coefficients of ‘0’ and ‘1’.

The Sender and Receiver must agree upon the

high and low order of the generator

size of the Generator polynomial to compute the checksum.

The computed checksum is appended to the transmitting frame. If the receiver gets the

frame it tries dividing it by Generator polynomial, if there is a reminde

transmission error, else no error.

The Generator polynomial

x16

+x12

+x5+1

The Binary equivalent of

Algorithm:

No Error Case

Sender side

• Get the input from "Input.txt"

• Call the In-built function readFile (szfilename). It returns the stored value to the

local variable ‘szcrc’.

• Convert the data string (szcrc) that has to be transmitted into a binary

representation.

Cyclic Redundancy Check

Write a program for error detecting code using CRC-CCITT (16

16 and CRC 32 are also available in NetSim)

Cyclic redundancy check (CRC) is a type of function that takes a data stream of any

, and produces an output. Bit strings are treated as representation of

polynomials with coefficients of ‘0’ and ‘1’.

The Sender and Receiver must agree upon the Generator Polynomial in advance. Both the

high and low order of the generator must be ‘1’. The size of data must be greater than the

size of the Generator polynomial to compute the checksum.

The computed checksum is appended to the transmitting frame. If the receiver gets the

frame it tries dividing it by Generator polynomial, if there is a reminder there has been a

transmission error, else no error.

Generator polynomial for CRC CCITT is given below,

equivalent of CRC - CCITT is 10001000000100001

Input.txt". Parse the file content.

built function readFile (szfilename). It returns the stored value to the

local variable ‘szcrc’.

Convert the data string (szcrc) that has to be transmitted into a binary

- 61 -

CCITT (16- bits).

Cyclic redundancy check (CRC) is a type of function that takes a data stream of any

, and produces an output. Bit strings are treated as representation of

in advance. Both the

size of data must be greater than the

The computed checksum is appended to the transmitting frame. If the receiver gets the

r there has been a

10001000000100001

built function readFile (szfilename). It returns the stored value to the

Convert the data string (szcrc) that has to be transmitted into a binary

NetSim Experiment Manual

1. Get ASCII value of the first

2. Divide the ASCII value by 2 and append the remainder to a string. The

quotient is taken as the next number for the division.

3. Repeat the above division until the quotient of the number is less than 2.

4. Finally a remainder string having 1’s and

the binary representation of that character.

5. Continue the above process for all the characters in the data string (szcrc).

• Append 16 ‘0’s to the final binary string formed by the above step.

• Divide the binary converted data string using the Generator Polynomial (as given

above in Concept).

1. Take the MSB 17 bits from the binary data string,

2. If the leading bit of the binary data string is ‘0’, do an XOR operation with

the 17 bits of ‘0’s

3. Else, if the leading bit of the binary data string is ‘1’, do an XOR operation

with the 17 bits with binary converted CRC

the remainder which is also 17 bits.

4. The first bit of the remainde

bits.

5. If there are successive bits in the data, make the previous remainder bit to

17 bits by bringing down the next bit into the data

• Convert the final remainder into HEXA equivalent character.

1. Divide the final

2. Convert each block into equivalent HEXA character.

3. Thus the output of this whole process will be a 4

attached to the transmitting frame.

Get ASCII value of the first character.

Divide the ASCII value by 2 and append the remainder to a string. The

quotient is taken as the next number for the division.

Repeat the above division until the quotient of the number is less than 2.

Finally a remainder string having 1’s and 0’s is obtained. This reminder is

the binary representation of that character.

Continue the above process for all the characters in the data string (szcrc).

Append 16 ‘0’s to the final binary string formed by the above step.

Divide the binary converted data string using the Generator Polynomial (as given

Take the MSB 17 bits from the binary data string,

If the leading bit of the binary data string is ‘0’, do an XOR operation with

the 17 bits of ‘0’s and get the remainder which is also 17 bits.

Else, if the leading bit of the binary data string is ‘1’, do an XOR operation

with the 17 bits with binary converted CRC - CCITT polynomial and get

the remainder which is also 17 bits.

The first bit of the remainder is left out and the remainder is made to 16

If there are successive bits in the data, make the previous remainder bit to

17 bits by bringing down the next bit into the data

Convert the final remainder into HEXA equivalent character.

the final remainder at the end of step 5.4 into blocks of 4 bits.

Convert each block into equivalent HEXA character.

Thus the output of this whole process will be a 4 - nibble checksum that is

attached to the transmitting frame.

- 62 -

Divide the ASCII value by 2 and append the remainder to a string. The

Repeat the above division until the quotient of the number is less than 2.

0’s is obtained. This reminder is

Continue the above process for all the characters in the data string (szcrc).

Append 16 ‘0’s to the final binary string formed by the above step.

Divide the binary converted data string using the Generator Polynomial (as given

If the leading bit of the binary data string is ‘0’, do an XOR operation with

also 17 bits.

Else, if the leading bit of the binary data string is ‘1’, do an XOR operation

CCITT polynomial and get

r is left out and the remainder is made to 16

If there are successive bits in the data, make the previous remainder bit to

into blocks of 4 bits.

nibble checksum that is

NetSim Experiment Manual

Receiver side CRC Coding

• Repeat the Steps 1 to 4 of the

for the data.

• Convert the HEXA equivalent string ‘szSender’ to its binary format. This is the

Hexadecimal to binary conversion process.

• Append the binary format of the above step to the ‘szcrc ’ variable. Then append

16 ‘0s’ to the ‘szcrc ’ variable.

• Repeat the Steps 5 and 6

value for the receiver side. The output is stored in the variable ‘szReceiv

of characters with size 10).

Error Case

Sender side

• Get the input from "Input.txt"

• Call the In-built function readFile (szfilename). It returns the stored value to the

local variable ‘szcrc ’.

• Convert the data string (szcrc ) to be transmitted into binary representation

1. Get ASCII value of the first character.

2. Divide the ASCII value by 2 and append the remainder to a string. The

quotient is taken as the next number for the division.

3. Repeat the above division

4. Finally we get the remainder string having 1’s and 0’s, which is the binary

representation of that character

5. Continue above process for all the characters in the data string (szcrc )

• Append 16 ‘0’s to the final binary string formed by the above step.

• Divide the binary converted data string using the Generator Polynomial (as given

above in Concept).

Receiver side CRC Coding

Repeat the Steps 1 to 4 of the Sender side CRC coding and get the ‘szcrc ’ value

Convert the HEXA equivalent string ‘szSender’ to its binary format. This is the

Hexadecimal to binary conversion process.

binary format of the above step to the ‘szcrc ’ variable. Then append

16 ‘0s’ to the ‘szcrc ’ variable.

Repeat the Steps 5 and 6 of the Sender Side CRC coding to calculate the CRC

value for the receiver side. The output is stored in the variable ‘szReceiv

of characters with size 10).

Input.txt". Parse the file content.

built function readFile (szfilename). It returns the stored value to the

local variable ‘szcrc ’.

string (szcrc ) to be transmitted into binary representation

Get ASCII value of the first character.

Divide the ASCII value by 2 and append the remainder to a string. The

quotient is taken as the next number for the division.

Repeat the above division until the quotient of the number is less than 2.

Finally we get the remainder string having 1’s and 0’s, which is the binary

representation of that character.

Continue above process for all the characters in the data string (szcrc )

Append 16 ‘0’s to the final binary string formed by the above step.

Divide the binary converted data string using the Generator Polynomial (as given

- 63 -

and get the ‘szcrc ’ value

Convert the HEXA equivalent string ‘szSender’ to its binary format. This is the

binary format of the above step to the ‘szcrc ’ variable. Then append

to calculate the CRC

value for the receiver side. The output is stored in the variable ‘szReceive’ (array

built function readFile (szfilename). It returns the stored value to the

string (szcrc ) to be transmitted into binary representation.

Divide the ASCII value by 2 and append the remainder to a string. The

until the quotient of the number is less than 2.

Finally we get the remainder string having 1’s and 0’s, which is the binary

Continue above process for all the characters in the data string (szcrc ).

Append 16 ‘0’s to the final binary string formed by the above step.

Divide the binary converted data string using the Generator Polynomial (as given

NetSim Experiment Manual

1. Take the MSB 17 bits from the binary data string,

2. If the leading bit of the binary

the 17 bits of ‘0’s and get the remainder which is also 17 bits.

3. Else if the leading bit of the binary data string is ‘1’, do an XOR operation

with the 17 bits with binary converted CRC

the remainder which is also 17 bits.

4. The first bit of the remainder is left out and the remainder is made to 16

bits.

5. If there are successive bits in the data, make the previous remainder bit to

17 bits by bringing down the next bit in the data

• Convert the final remainder into HEXA equivalent character.

1. Divide the final

2. Convert each block into equivalent HEXA character.

3. Thus the output of this whole process will be a 4

attached to the transmitting frame.

Receiver side

• Repeat the Steps 1 to 4 of the

for the data.

• Make some errors in the string ‘szcrc ’ by changing certain characters. The error

string is stored in the variable ‘szcrc ’.

• Write the Error string ‘szcrc ’ into the file ‘Input.txt’. The file path for the file

‘Input.txt" is the path where you have insta

(Compulsory).

• Convert the HEXA equivalent string ‘szSender’ to its binary format. This is the

Hexadecimal to binary conversion process.

• Append the binary format of the above step to the ‘szcrc ’ variable. Then append

16 ‘0s’ to the ‘szcrc ’ variable.

• Repeat the Steps 5 and 6

value for the receiver side.

Take the MSB 17 bits from the binary data string,

If the leading bit of the binary data string is ‘0’, do an XOR operation with

the 17 bits of ‘0’s and get the remainder which is also 17 bits.

Else if the leading bit of the binary data string is ‘1’, do an XOR operation

with the 17 bits with binary converted CRC - CCITT polynomial and g

the remainder which is also 17 bits.

The first bit of the remainder is left out and the remainder is made to 16

If there are successive bits in the data, make the previous remainder bit to

17 bits by bringing down the next bit in the data

rt the final remainder into HEXA equivalent character.

Divide the final remainder at the end of step 5.4 into blocks of 4 bits.

Convert each block into equivalent HEXA character.

Thus the output of this whole process will be a 4-nibble checksum that is

attached to the transmitting frame.

Repeat the Steps 1 to 4 of the Sender side CRC coding and get the ‘szcr

Make some errors in the string ‘szcrc ’ by changing certain characters. The error

string is stored in the variable ‘szcrc ’.

Write the Error string ‘szcrc ’ into the file ‘Input.txt’. The file path for the file

‘Input.txt" is the path where you have installed the NetSim application.

Convert the HEXA equivalent string ‘szSender’ to its binary format. This is the

Hexadecimal to binary conversion process.

Append the binary format of the above step to the ‘szcrc ’ variable. Then append

’ to the ‘szcrc ’ variable.

Repeat the Steps 5 and 6 of the Sender Side CRC coding to calculate the CRC

value for the receiver side.

- 64 -

data string is ‘0’, do an XOR operation with

the 17 bits of ‘0’s and get the remainder which is also 17 bits.

Else if the leading bit of the binary data string is ‘1’, do an XOR operation

CCITT polynomial and get

The first bit of the remainder is left out and the remainder is made to 16

If there are successive bits in the data, make the previous remainder bit to

into blocks of 4 bits.

nibble checksum that is

and get the ‘szcrc ’ value

Make some errors in the string ‘szcrc ’ by changing certain characters. The error

Write the Error string ‘szcrc ’ into the file ‘Input.txt’. The file path for the file

application.

Convert the HEXA equivalent string ‘szSender’ to its binary format. This is the

Append the binary format of the above step to the ‘szcrc ’ variable. Then append

of the Sender Side CRC coding to calculate the CRC

NetSim Experiment Manual

Procedure:

To begin with the experiment, open NetSim

Click on Programming in the menu bar, 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.

The scenario will be obtained as shown below. Follow the steps.

Click

Run to

execute

To begin with the experiment, open NetSim

in the menu bar, select Error Detecting Codes and then select

The scenario will be obtained as shown below. Follow the steps.

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

The scenario will be obtained as shown below. Follow the steps.

Select Mode

Select any of

the algorithms

Select Error

condition

Click here to add

the input text file

Click here to view

concept,

algorithm, pseudo

Code & flow

chart Click here to

interface source

- 65 -

nd then select

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

Select Mode

Select any of

algorithms

Select Error

Click here to add

the input text file

Click here to view

algorithm, pseudo

Code & flow Click here to

interface source

NetSim Experiment Manual

Results:

Error condition: No Error

Error condition: Error

- 66 -

NetSim Experiment Manual

Experiment 11 - Sorting (Bubble

Objective: Write a program for frame sorting technique used in buffers.

(Note: Insertion, Quick and Selection Sorting Techniques are also

Theory:

Sorting is the ordering of data in either an increasing or decreasing order

fundamental challenges of computer science is ordering a list of items.

are designed with the following objectives:

1. Minimize exchange or wholesale movement of data.

2. Move data from secondary storage to main memory in large blocks. This is done

because larger the data blocks, more the efficiency of the algorithm

part of external sorting.

3. If possible, retain all the data in main memory. In this case, random access into an

array can be effectively use

There are three important considerations that will affect a programmer’s decision to

choose from a variety of sorting methods.

1. Time to write the program.

2. Execution time of the program.

3. Memory or auxiliary space needed for the

In this exercise, we will look at the “Bubble” sort algorithm.

By selecting ‘Sample’ option, user can visualize the sorting for the given input data and

understand the concept of Sorting.

Algorithm:

Bubble sort derives its name from the fac

of the sorted array.

The algorithm begins by comparing the top item of the array with the next, and swapping

them if necessary. After n –

to the bottom of the array, to the

Sorting (Bubble Sort)

Write a program for frame sorting technique used in buffers.

ion, Quick and Selection Sorting Techniques are also available in Net

Sorting is the ordering of data in either an increasing or decreasing order.

fundamental challenges of computer science is ordering a list of items. Sorting algorithms

are designed with the following objectives:

Minimize exchange or wholesale movement of data.

Move data from secondary storage to main memory in large blocks. This is done

because larger the data blocks, more the efficiency of the algorithm

part of external sorting.

possible, retain all the data in main memory. In this case, random access into an

array can be effectively used. This is a key part in internal sorting

There are three important considerations that will affect a programmer’s decision to

choose from a variety of sorting methods.

Time to write the program.

Execution time of the program.

Memory or auxiliary space needed for the program’s environment.

In this exercise, we will look at the “Bubble” sort algorithm.

’ option, user can visualize the sorting for the given input data and

understand the concept of Sorting.

Bubble sort derives its name from the fact that the smallest data item bubbles up to the top

The algorithm begins by comparing the top item of the array with the next, and swapping

1 comparisons, the largest among a total of n

he bottom of the array, to the nth location.

- 67 -

available in NetSim)

. One of the

Sorting algorithms

Move data from secondary storage to main memory in large blocks. This is done

because larger the data blocks, more the efficiency of the algorithm. This is a key

possible, retain all the data in main memory. In this case, random access into an

sorting.

There are three important considerations that will affect a programmer’s decision to

environment.

’ option, user can visualize the sorting for the given input data and

t that the smallest data item bubbles up to the top

The algorithm begins by comparing the top item of the array with the next, and swapping

n items descends

NetSim Experiment Manual

The process is then reapplied to the remaining

the method requires n (n – 1)/2

swaps. The bubble sort, theref

Procedure:

To begin with the experiment, open NetSim

Click on Programming in the menu bar, select

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.

The scenario will be obtained as shown below. Follow the steps.

The process is then reapplied to the remaining n – 1 items of the array. For

1)/2 comparisons and, on the average, almost one

swaps. The bubble sort, therefore, is inefficient in large sorting jobs.

To begin with the experiment, open NetSim

in the menu bar, select Sorting Techniques and then select

The scenario will be obtained as shown below. Follow the steps.

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

The scenario will be obtained as shown below. Follow the steps.

Select Mode

Select Type

Select Order

Select the value for how many

numbers to be sort

Give the value

After give the value, click Add

Click run to execute

Click here to interface source

code

Click here to view concept,

algorithm, pseudo Code & flow

chart

- 68 -

items of the array. For n data items,

comparisons and, on the average, almost one-half as many

and then select Bubble.

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

Select the value for how many

After give the value, click Add

Click here to interface source

ere to view concept,

pseudo Code & flow

NetSim Experiment Manual

Results:

Output

table

- 69 -

Output

table

NetSim Experiment Manual

Experiment 12 – Distance Vector Routing

Objective: Write a program for distance vector algo

transmission.

Theory:

Distance Vector Routing is one of the routing algorithms used in a

for computing shortest path between source and destination. The router is one of the

main devices used in a wide area network. The main task of the router is routing. It

the routing table and delivers the packets depending upon the routes in the table

directly or via an intermediate device (perhaps another router).

Each router initially has information about its all neighbors (i.e., it is directly connected

After a period of time, each router exchanges its routing table among its neighbors. After

certain number of exchanges, all routers will have the full routing information about the

area of the network. After each table exchange, router re

between the routers. The algorithm used for this routing is called Distance Vector

Routing.

Algorithm:

Repeat the following steps until there is no change in the routing table for all routers.

• 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 router’s 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 g

than the its neighbor’s entry.

• Write the next stage of routing table into the file.

Distance Vector Routing

Write a program for distance vector algorithm to find suitable path for

Distance Vector Routing is one of the routing algorithms used in a Wide Area Network

for computing shortest path between source and destination. The router is one of the

main devices used in a wide area network. The main task of the router is routing. It

the routing table and delivers the packets depending upon the routes in the table

directly or via an intermediate device (perhaps another router).

Each router initially has information about its all neighbors (i.e., it is directly connected

After a period of time, each router exchanges its routing table among its neighbors. After

certain number of exchanges, all routers will have the full routing information about the

area of the network. After each table exchange, router re-computes the shortest path

between the routers. The algorithm used for this routing is called Distance Vector

Repeat the following steps until there is no change in the routing table for all routers.

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

um cost among them. The minimum cost value details are taken as a

new entry: such as source router, intermediate router, destination router and cost

Update the source router routing table cost value if both the destination router and the

mediate router field value have the same value as any one of the neighbors’

Update the source router’s 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 g

than the its neighbor’s entry.

Write the next stage of routing table into the file.

- 70 -

rithm to find suitable path for

Wide Area Network

for computing shortest path between source and destination. The router is one of the

main devices used in a wide area network. The main task of the router is routing. It forms

the routing table and delivers the packets depending upon the routes in the table – either

Each router initially has information about its all neighbors (i.e., it is directly connected).

After a period of time, each router exchanges its routing table among its neighbors. After

certain number of exchanges, all routers will have the full routing information about the

hortest path

between the routers. The algorithm used for this routing is called Distance Vector

Repeat the following steps until there is no change in the routing table for all routers.

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

um cost among them. The minimum cost value details are taken as a

new entry: such as source router, intermediate router, destination router and cost

Update the source router routing table cost value if both the destination router and the

mediate router field value have the same value as any one of the neighbors’

Update the source router’s 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

NetSim Experiment Manual

Repeat steps 1 to 5 for all routers.

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

When you select the User mode, you have to write your own program in C/C++, compile

and link to NetSim software for validation. Cli

proceed with your own code.

The scenario will be obtained as shown below. Follow the steps.

Select Mode

Connect the Routers

Repeat steps 1 to 5 for all routers.

Check whether any changes are made in any of the routers. If yes, then repeat the above

steps, otherwise, quit the process.

To begin with the experiment, open NetSim

from the menu bar and select Distance Vector Routing

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.

The scenario will be obtained as shown below. Follow the steps.

Connect the Routers

Click Run to execute

Click here to view Concept, Algorithm,

pseudo Code & Flowchart

Click here to interface source code

- 71 -

Check whether any changes are made in any of the routers. If yes, then repeat the above

Distance Vector Routing

mode, you have to write your own program in C/C++, compile

ck on the F1 (Help) for details on how to

Click here to view Concept, Algorithm,

Click here to interface source code

NetSim Experiment Manual

Results:

Output Table

- 72 -

Output Table

NetSim Experiment Manual

Experiment 13 – TCP/IP Sockets

Objective: Write Using TCP/IP sockets, write a client

client send the file name and to make the server send back the contents of the requested

file if present.

Theory:

The socket is a fundamental concept to the operation of TCP/IP

also an interface between the application and the network. The exchange of data between

a pair of devices consists of a series of messages sent from a socket on one device to a

socket on other.

Once the socket is configured, th

transmission and receive the data using sockets from the other host. A socket

communication can be connection oriented (TCP sockets) or connectionless (UDP

sockets).

There is a receiver (TCP) serve

communications. There can be two

Algorithm:

• Create a socket using address family (AF_INET), type (SOCK_STREM) and

protocol (TCP)

• Initialize the address family,

• Bind a local address and port number with a socket

• Listen for an incoming socket connection

• Accept an incoming connection attempt on a socket

• Receive an incoming message

• Write that incoming message to Output.txt

• Send ACK to received socket

• Call step 5 to receive the message

• Close file

• Close socket

TCP/IP Sockets

Write Using TCP/IP sockets, write a client – server program to make the

client send the file name and to make the server send back the contents of the requested

The socket is a fundamental concept to the operation of TCP/IP application software.

also an interface between the application and the network. The exchange of data between

a pair of devices consists of a series of messages sent from a socket on one device to a

Once the socket is configured, the application can send the data using sockets for network

transmission and receive the data using sockets from the other host. A socket

communication can be connection oriented (TCP sockets) or connectionless (UDP

There is a receiver (TCP) server, which listens to the sender (TCP) client

communications. There can be two-way communication.

Create a socket using address family (AF_INET), type (SOCK_STREM) and

Initialize the address family, port no and IP address to communicate using sockets

Bind a local address and port number with a socket

Listen for an incoming socket connection

Accept an incoming connection attempt on a socket

Receive an incoming message

Write that incoming message to Output.txt

Send ACK to received socket

step 5 to receive the message once again

- 73 -

server program to make the

client send the file name and to make the server send back the contents of the requested

application software. It is

also an interface between the application and the network. The exchange of data between

a pair of devices consists of a series of messages sent from a socket on one device to a

e application can send the data using sockets for network

transmission and receive the data using sockets from the other host. A socket

communication can be connection oriented (TCP sockets) or connectionless (UDP

r, which listens to the sender (TCP) client

Create a socket using address family (AF_INET), type (SOCK_STREM) and

unicate using sockets

NetSim Experiment Manual

Procedure:

To begin with the experiment, open NetSim

Click on Programming from the menu bar and select

select Socket Programming

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.

The scenario will be obtained as shown below.

• Under Input there are two things,

1. When Operation is Client

should be given in the

2. When Operation is Server

would be automatically filled in the

To begin with the experiment, open NetSim

from the menu bar and select PC to PC Communication

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.

The scenario will be obtained as shown below. Follow the steps

there are two things,

Client, then the Server’s IP Address (Ex: 192.168.1.2)

should be given in the Server IP Address field.

Server, then the Server’s IP Address (Ex: 192.168.1.2)

would be automatically filled in the Local IP Address field.

Select Mode

Select Protocol

Select Operation

Click Run to

start

Click here to

view Concept,

Algorithm, and

Pseudo Code &

Flowchart

Click here to

interface source

- 74 -

PC to PC Communication and then

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

(Ex: 192.168.1.2)

(Ex: 192.168.1.2)

Select Mode

Select Protocol

elect Operation

Click Run to

Click here to

view Concept,

Algorithm, and

Pseudo Code &

Flowchart

Click here to

interface source

NetSim Experiment Manual

If the Operation is Server, the scenario will

If the Operation is Client, the scenario will be obtained as shown below

he scenario will be obtained as shown below,

he scenario will be obtained as shown below,

- 75 -

be obtained as shown below,

Server

Side

Client

Side

NetSim Experiment Manual

Procedure:

TCP

• First the Server should

on the Run button to Create the socket

• Client should click on the

• The Client should click on the

• The Client should click on the

Server.

• If the Data is successfully transmitted then the

Server System.

UDP

• First the Server should

on the Run button to Create the socket

• The Client should click on the

• The Client should click on the

Server.

• If the Data is successfully transmitted then the

Server System.

should click on the Run button after which the Client

Create the socket

should click on the Connect button to establish the connection with server

should click on the Send button to transmit the data to the

should click on the Close button to terminate the Connection with

is successfully transmitted then the Sent Data would be

should click on the Run button after which the Client

Create the socket

should click on the Send button to transmit the data to the

should click on the Close button to terminate the Connection with

is successfully transmitted then the Sent Data would be

- 76 -

Client should click

establish the connection with server.

button to transmit the data to the Server.

button to terminate the Connection with

would be Received in the

Client should click

button to transmit the data to the Server.

button to terminate the Connection with

would be Received in the

NetSim Experiment Manual

Results:

Received

data

Enter Destination

IP Address

Enter data to be

transmitted

- 77 -

Received

data

Enter Destination

IP Address

Enter data to be

transmitted

NetSim Experiment Manual

Experiment 15 - RSA

Objective:

Write a program for simple RSA algorithm to encrypt and decrypt the data

Theory:

The Application Layer takes care of network security. Different encryption and

decryption techniques are used to provide security to the data

Among these, is the public-key cryptography. Public

to have two keys: a public key, used by the entire world for encrypting messages to be

sent to the user; and a private key which the user ne

RSA algorithm was discovered at the Massachusetts Institute of Technology (MIT). RSA

stands for the initials of the three who discovered the algorithm: Rivest, Shamir and

Adleman.

Algorithm:

The technique followed is:

1. Choose two large primes,

2. Compute n = p * q and z = ( p

3. Choose a number

4. Find Ks such that (Ks * Kp) mod z = 1.

To encrypt a message, P, compute C = P

n). It can be proven that for all P in the specified range, the encryption and decryption

functions are inversed. To perform the encryption, we need

decryption, we need Kp and

private key consist of (Kp,n).

Procedure:

To begin with the experiment, open NetSim

Click on Programming from the menu bar and select

Advanced�RSA

Write a program for simple RSA algorithm to encrypt and decrypt the data

The Application Layer takes care of network security. Different encryption and

decryption techniques are used to provide security to the data that is to be transmitted.

key cryptography. Public-key cryptography requires each user

to have two keys: a public key, used by the entire world for encrypting messages to be

sent to the user; and a private key which the user needs for decrypting messages.

algorithm was discovered at the Massachusetts Institute of Technology (MIT). RSA

stands for the initials of the three who discovered the algorithm: Rivest, Shamir and

e two large primes, p and q, (typically greater than 10

Compute n = p * q and z = ( p - 1 ) * ( q - 1 ).

Choose a number relatively prime to z and call it Kp.

Find Ks such that (Ks * Kp) mod z = 1.

To encrypt a message, P, compute C = PKs

(mod n). To decrypt C, compute P = C

n). It can be proven that for all P in the specified range, the encryption and decryption

functions are inversed. To perform the encryption, we need Ks and n. To perform the

and n. Therefore, the public key consist of the pair (Ks

).

To begin with the experiment, open NetSim

from the menu bar and select Cryptography and then select

- 78 -

Write a program for simple RSA algorithm to encrypt and decrypt the data

The Application Layer takes care of network security. Different encryption and

that is to be transmitted.

key cryptography requires each user

to have two keys: a public key, used by the entire world for encrypting messages to be

eds for decrypting messages.

algorithm was discovered at the Massachusetts Institute of Technology (MIT). RSA

stands for the initials of the three who discovered the algorithm: Rivest, Shamir and

(typically greater than 10100

).

To decrypt C, compute P = CKp

(mod

n). It can be proven that for all P in the specified range, the encryption and decryption

To perform the

ublic key consist of the pair (Ks,n) and the

and then select

NetSim Experiment Manual

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.

The scenario will be obtained as shown below. Follow the steps

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.

The scenario will be obtained as shown below. Follow the steps

Select Mode

Give Character

Click Run to execute

Click here to view

Concept, Algorithm, and

Pseudo Code & Flowchart

Click here to

Interface Source

- 79 -

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

Give Character

Click Run to execute

here to view

Concept, Algorithm, and

Pseudo Code & Flowchart

Interface Source

NetSim Experiment Manual

Results:

- 80 -

Output

NetSim Experiment Manual

Experiment 16 - Hamming Code

Objective: Write a program for Hamming code generation for

correction

Theory:

Hamming code is for Single Bit Error Detection and Correction. It is based on Parity

(Even / Odd Parity).

It allows any single bit error to be detected and corrected. It involv

check bits (depending on the formula) to the data for error detection as well as error

correction. These bits are called

introduced in the message bits, there is a general formula.

Formula:

For a message of size m bits and

should be valid.

Example:

Consider the message size (m) of 4 bits and we will find out the number of check bits

according to the formula,

When r = 3 we have,

4 + 3 + 1 = 8 and 2 3 is 8 and so the number of

Algorithm

Read the contents of the input file i.e. the input data, type of parity and the error data from

the ‘Input.txt’ and store it in variables like the above method.

1. Get the length of the input data and calculate the number of Check Bits to be

introduced according to the condition (m + r + 1) <= 2

original data and r is the number of check bits to be introduced in the string.

2. If the passed flag (type of parity) is 2, then it is

3. Place the Check Bits at the appropriate position according to the principle

explained above (Calculation and Placement of Check Bits in Hamming Code) for

the Input data and for the Error data.

Hamming Code

program for Hamming code generation for error detection and

Hamming code is for Single Bit Error Detection and Correction. It is based on Parity

It allows any single bit error to be detected and corrected. It involves adding one or four

check bits (depending on the formula) to the data for error detection as well as error

correction. These bits are called Check Bits. In order to find the number of check bits

introduced in the message bits, there is a general formula.

bits and r check bits, then the condition (m + r + 1) < = 2

Consider the message size (m) of 4 bits and we will find out the number of check bits

is 8 and so the number of Check Bits to be introduced is 3.

Read the contents of the input file i.e. the input data, type of parity and the error data from

the ‘Input.txt’ and store it in variables like the above method.

the length of the input data and calculate the number of Check Bits to be

introduced according to the condition (m + r + 1) <= 2r. Where m

is the number of check bits to be introduced in the string.

(type of parity) is 2, then it is Even parity, else it is

Place the Check Bits at the appropriate position according to the principle

explained above (Calculation and Placement of Check Bits in Hamming Code) for

the Input data and for the Error data.

- 81 -

error detection and

Hamming code is for Single Bit Error Detection and Correction. It is based on Parity

es adding one or four

check bits (depending on the formula) to the data for error detection as well as error

In order to find the number of check bits

(m + r + 1) < = 2 r

Consider the message size (m) of 4 bits and we will find out the number of check bits

to be introduced is 3.

Read the contents of the input file i.e. the input data, type of parity and the error data from

the length of the input data and calculate the number of Check Bits to be

is length of the

is the number of check bits to be introduced in the string.

arity, else it is Odd parity.

Place the Check Bits at the appropriate position according to the principle

explained above (Calculation and Placement of Check Bits in Hamming Code) for

NetSim Experiment Manual

4. Compare the Check Bits values of the Original Input Data and t

values. Keep a note of the Check Bit Position where the value differs.

5. Add all the position of the Check Bits where the values differ. The resultant value

gives the position of the error bit in the Error Data of length ( m + r ) i.e. the tot

length which includes the length of the Input Data Bits and the Check Bits.

Procedure:

To begin with the experiment, open NetSim

Click on Programming from the menu bar and select

select Hamming Code

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.

The scenario will be obtained as shown below. Follow the steps

Step 1:

Compare the Check Bits values of the Original Input Data and the Error Data

values. Keep a note of the Check Bit Position where the value differs.

Add all the position of the Check Bits where the values differ. The resultant value

gives the position of the error bit in the Error Data of length ( m + r ) i.e. the tot

length which includes the length of the Input Data Bits and the Check Bits.

To begin with the experiment, open NetSim

from the menu bar and select Error Correcting Code

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.

The scenario will be obtained as shown below. Follow the steps

Select the

Mode

Select

the Parity

- 82 -

he Error Data

values. Keep a note of the Check Bit Position where the value differs.

Add all the position of the Check Bits where the values differ. The resultant value

gives the position of the error bit in the Error Data of length ( m + r ) i.e. the total

length which includes the length of the Input Data Bits and the Check Bits.

Error Correcting Code and then

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

Select the

Select

the Parity

NetSim Experiment Manual

Step 2:

After that you can type the input in the Textbox and Select the error position which is

shown below

After that you can type the input in the Textbox and Select the error position which is

Enter the Data

Select the Error

Position

Click run to execute

Click here to view the Concept,

Algorithm, Pseudo code and Flow

chart

Click here to Interface

Source Code

- 83 -

After that you can type the input in the Textbox and Select the error position which is

Click here to view the Concept,

code and Flow

Click here to Interface

NetSim Experiment Manual

Results:

After you click RUN button you can see the Hamming string, Original data and Error data

in binary format as shown in the following

After you click RUN button you can see the Hamming string, Original data and Error data

in binary format as shown in the following screen shots

- 84 -

After you click RUN button you can see the Hamming string, Original data and Error data

NetSim Experiment Manual

Output

- 85 -

Output

NetSim Experiment Manual

Experiment 17 - Leaky Bucket Algorithm

Objective:

Write a program for congestion control using leaky bucket algorithm.

Theory:

1. This is a type of traffic shaping algorithm. Traffic shaping allows control of the

traffic in the network to improve performance of the network.

2. An application before transmitting, agrees upon a peak cell rate. This algorithm

will not allow packets more t

3. This algorithm will also avoid burst of data arrival which could lead to congestion.

4. One of the major reas

network. This algorithm is used to avoid the burst

5. Burst input data is stored in a buffer and output at a constant rate. If the input rate

is larger than the output rate and the buffer is full, the extra data is discarded and

not transmitted.

Algorithm:

1. Read data ‘Input.txt’ file, which has the requir

2. Parse the content of the file from which you get the input rate for each second,

buffer size, output rate per second and store in separate variables.

3. Follow the steps outlined below for time starting from 0 to 10.

4. If input rate is larger than t

packet output for the corresponding second) and for the remaining input packets,

check for buffer availability.

5. If the buffer value is larger than or equal to the remaining input packets, store the

remaining packets in the buffer. Else, if the buffer capacity is lesser, then store up

to the capacity of the buffer and discard the rest of the packets. Increment timer.

6. If the input rate is equal to the output rate, no packet is stored in the buffer. (St

the output rate, discard packet as zero, for the corresponding second). Increment

timer.

Leaky Bucket Algorithm

Write a program for congestion control using leaky bucket algorithm.

This is a type of traffic shaping algorithm. Traffic shaping allows control of the

traffic in the network to improve performance of the network.

An application before transmitting, agrees upon a peak cell rate. This algorithm

will not allow packets more than the agreed peak cell rate.

This algorithm will also avoid burst of data arrival which could lead to congestion.

One of the major reasons for congestion is the burst kind of data arrival in the

ithm is used to avoid the burst traffic.

input data is stored in a buffer and output at a constant rate. If the input rate

is larger than the output rate and the buffer is full, the extra data is discarded and

’ file, which has the required data.

Parse the content of the file from which you get the input rate for each second,

buffer size, output rate per second and store in separate variables.

Follow the steps outlined below for time starting from 0 to 10.

If input rate is larger than the output rate, less the output rate (store the rate of

packet output for the corresponding second) and for the remaining input packets,

check for buffer availability.

If the buffer value is larger than or equal to the remaining input packets, store the

emaining packets in the buffer. Else, if the buffer capacity is lesser, then store up

to the capacity of the buffer and discard the rest of the packets. Increment timer.

If the input rate is equal to the output rate, no packet is stored in the buffer. (St

the output rate, discard packet as zero, for the corresponding second). Increment

- 86 -

This is a type of traffic shaping algorithm. Traffic shaping allows control of the

An application before transmitting, agrees upon a peak cell rate. This algorithm

This algorithm will also avoid burst of data arrival which could lead to congestion.

kind of data arrival in the

input data is stored in a buffer and output at a constant rate. If the input rate

is larger than the output rate and the buffer is full, the extra data is discarded and

Parse the content of the file from which you get the input rate for each second,

buffer size, output rate per second and store in separate variables.

store the rate of

packet output for the corresponding second) and for the remaining input packets,

If the buffer value is larger than or equal to the remaining input packets, store the

emaining packets in the buffer. Else, if the buffer capacity is lesser, then store up

to the capacity of the buffer and discard the rest of the packets. Increment timer.

If the input rate is equal to the output rate, no packet is stored in the buffer. (Store

the output rate, discard packet as zero, for the corresponding second). Increment

NetSim Experiment Manual

7. If the input rate is less than the output rate, no packet is stored in the buffer. (Store

the input rate as output rate, discard packet as zero, for the correspon

Increment timer.

8. Follow the steps outlined below until buffer capacity is zero.

9. If the buffer value is non

the buffer value is more than the output rate. (Store the output rate, disca

as zero, for the corresponding second). Increment timer.

10. If the buffer value is non

less than or equal to the output rate. (Store the buffer

as zero for the corresponding second). Increment timer.

11. Store the total time value.

12. Write the required values to the output file ‘Output.txt’.

Procedure:

To begin with the experiment, open NetSim

Click on Programming from the menu bar and select

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.

The scenario will be obtained as shown below

If the input rate is less than the output rate, no packet is stored in the buffer. (Store

the input rate as output rate, discard packet as zero, for the correspon

Follow the steps outlined below until buffer capacity is zero.

If the buffer value is non-zero, reduce the buffer capacity by the output rate

the buffer value is more than the output rate. (Store the output rate, disca

as zero, for the corresponding second). Increment timer.

If the buffer value is non-zero, reduce the buffer capacity to 0 if the buffer value is

less than or equal to the output rate. (Store the buffer capacity; discard the packet

e corresponding second). Increment timer.

Store the total time value.

Write the required values to the output file ‘Output.txt’.

To begin with the experiment, open NetSim

from the menu bar and select Leaky Bucket Algorithm.

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.

The scenario will be obtained as shown below. Follow the steps

- 87 -

If the input rate is less than the output rate, no packet is stored in the buffer. (Store

the input rate as output rate, discard packet as zero, for the corresponding second).

zero, reduce the buffer capacity by the output rate – if

the buffer value is more than the output rate. (Store the output rate, discard packet

zero, reduce the buffer capacity to 0 if the buffer value is

discard the packet

Algorithm.

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

NetSim Experiment Manual

Select Mode

Give Input capacity

Give Output capacity

Give Buffer capacity

Click run to execute

Click here to Concept, Algorithm,

and Pseudo Code & Flow Chart

Click here to Interface

Source Code

- 88 -

Give Input capacity

Output capacity

Give Buffer capacity

Click run to execute

Click here to Concept, Algorithm,

and Pseudo Code & Flow Chart

Click here to Interface

NetSim Experiment Manual

Results:

- 89 -

Output