SlideShare a Scribd company logo
1 of 200
Download to read offline
Experiment Manual
The information contained in this document represents the current view of TETCOS on the
issues discussed as of the date of publication. Because TETCOS must respond to changing
market conditions, it should not be interpreted to be a commitment on the part of TETCOS,
and TETCOS cannot guarantee the accuracy of any information presented after the date of
publication.
This manual is for informational purposes only. TETCOS MAKES NO WARRANTIES,
EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS
DOCUMENT.
Warning! DO NOT COPY
Copyright in the whole and every part of this manual belongs to TETCOS and may not be
used, sold, transferred, copied or reproduced in whole or in part in any manner or in any
media to any person, without the prior written consent of TETCOS. If you use this manual
you do so at your own risk and on the understanding that TETCOS shall not be liable for any
loss or damage of any kind.
TETCOS may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from TETCOS, the furnishing of this document does not give you
any license to these patents, trademarks, copyrights, or other intellectual property. Unless
otherwise noted, the example companies, organizations, products, domain names, e-mail
addresses, logos, people, places, and events depicted herein are fictitious, and no association
with any real company, organization, product, domain name, email address, logo, person,
place, or event is intended or should be inferred.
Rev 9.0 (MAH CCN), October 2016 , TETCOS. All rights reserved.
All trademarks are property of their respective owner.
Contact us at –
TETCOS
214, 39th A Cross, 7th Main, 5th Block Jayanagar,
Bangalore - 560 041, Karnataka, INDIA. Phone: +91 80 26630624
E-Mail: sales@tetcos.com
Visit: www.tetcos.com
Contents
1. Networking Architecture.......................................................................6
2. Configure and analyze the TCP versus UDP response Time With HTTP
Application.....................................................................................................6
3. Simulation of different types of internet traffic such as FTP, TELNET
over a network and analyzing the throughput..............................................10
4. Network Socket Programming.............................................................15
5. Simulating a three node point-to-point network and applying relevant
applications over TCP and UDP.....................................................................23
6. Stop & Wait Protocol...........................................................................28
7. Go Back N Protocol..............................................................................33
8. Selective Repeat Protocol....................................................................40
9. Study the throughputs of Slow start + Congestion avoidance (Old
Tahoe) and Fast Retransmit (Tahoe) Congestion Control Algorithms............47
10. Implementation of QoS in IEEE 802.11e Network ................................56
11. Study the working and routing table formation of Interior routing
protocols, i.e. Routing Information Protocol (RIP) and Open Shortest Path
First (OSPF) ..................................................................................................61
12. Experiment on M/D/1 Queue:.............................................................69
13. Datagram network ..............................................................................74
14. Distance Vector Routing......................................................................74
15. IPV6 Addressing - EUI-64 Interface Identifier.......................................81
16. IPV6 Host Addresses............................................................................84
17. IPV6 Subnetting...................................................................................87
18. Link State Routing ...............................................................................91
19. Study the working of BGP and formation of BGP Routing table...........98
20. Analyze the performance of a MANET, (running CSMA/CA (802.11b) in
MAC) with increasing node mobility...........................................................103
21. Spanning Tree ...................................................................................108
22. Analyzing the difference between Hub Vs Switch transmission .........115
23. Study the effect of Peak Cell Rate (per Sec) and Cell Delay Variation
Tolerance on the performance of an ATM Networks....................................56
24. Network performance analysis with an ATM switch implementing
different scheduling techniques like First in First out (FIFO), Priority, and
Round Robin ................................................................................................60
25. Understand IP forwarding within a LAN and across a router................74
26. Study how the Data Rate of a Wireless LAN (IEEE 802.11b) network
varies as the distance between the Access Point and the wireless nodes is
varied...........................................................................................................81
27. Analyze the performance of a MANET, (running CSMA/CA (802.11b) in
MAC) with increasing node density ..............................................................86
28. Understand the impact of bit error rate on packet error and investigate
the impact of error of a simple hub based CSMA / CD network....................95
29. To determine the optimum persistence of a p-persistent CSMA / CD
network for a heavily loaded bus capacity. ................................................100
30. To study the working of Time Division Multiple Access technique.....104
31. Orthogonal Frequency Division Multiple Access................................107
32. Plot the characteristic curve throughput versus offered traffic for a
Slotted ALOHA system. ..............................................................................112
33. Physical layer services and system ....................................................117
34. Study how call blocking probability varies as the load on a GSM
network is continuously increased. ............................................................117
35. Analysis of GSM Handover ................................................................121
36. Study how the number of channels increases and the Call blocking
probability decreases as the Voice activity factor of a CDMA network is
decreased ..................................................................................................124
37. Mobility Models in Wi-MAX (IEEE 802.16e/m) Network....................128
1.Networking Architecture
1.1 OSI model, TCP-IP Model
Refer: Study theory from NetSim “Basic Menu Introduction Networking Architecture”
2.Configure and analyze the TCP versus UDP
response Time With HTTP Application
2.1 Theory
TCP provides connection-oriented service at the transport layer, and UDP provides
connectionless service. As a result, a data exchange using TCP can take longer than the same
exchange using UDP. TCP implementations require that the TCP source and destination
perform a three-way handshake in order to set up the connection prior to sending data, and a
four-way handshake when tearing down the connection. In addition, all data must be
acknowledged by the destination when it is received. UDP sources, on the other hand, do not
set up connections and so save the overhead in terms of delay and bandwidth usage. UDP is
often used when small amounts of data must be sent, for example, when doing credit card
verification. If large amounts of data are sent, however, the extra TCP overhead may be
negligible in comparison to the entire transaction completion time
Part-A – TCP
2.2 Procedure:
Sample 1
Step 1:
Go to Simulation  New  Internetworks
Step 2:
Click & drop 2 Wired Nodes and 1
Router on the Simulation Environment
as shown and link them.
Application Properties
Application Type HTTP
Source_Id 2(Wired Node D)
Destination_Id 3(Wired Node C)
Page Property
Distribution Constant
Page Count 10
Page Size (bytes) 1000
Inter Arrival Time
Distribution Constant
Value ( secs) 1
Step 3:
Enable Packet Trace in Ribbon
Step 4:
Simulation Time - 10 sec
(Note: The Simulation Time can be selected only after the following two tasks,
 Enable Packet Trace
 Click on Run Simulation button.
After completion of the experiment, “Save” the experiment for future analysis of results.
Part-B – UDP
2.3 Procedure:
Sample 2:
Open Sample 1 and Disable TCP in Transport Layer in both Wired Nodes and Router.
Simulation Time - 10 sec
(Note: The Simulation Time can be selected only after the following two tasks,
 Enable Packet Trace
 Click on Run Simulation button)
2.3.1 Output:
Open Packet Trace from performance metrics window
Apply filter option from Excel sheet, filter PACKET TYPE column: Select only HTTP
TCP Packet Trace
TCP Response Time: 1000385.28 - 1000054.56 = 330.72
UDP Packet Trace
UDP Response Time: 1000321.12-1000000.96=320.16
Response Time
( micro. sec)
TCP 330.72
UDP 320.16
2.4 Inference:
Response time of TCP is greater than UDP. Since TCP performs three way handshake
mechanisms, for each packet it has to wait for an acknowledgement. But in case of UDP,
there is no acknowledgement. Hence compared to TCP, UDP has less Response
3.Simulation of different types of internet
traffic such as FTP, TELNET over a network
and analyzing the throughput
3.1 Theory:
FTP is File Transfer Protocol that transfers the files from source to destination. It is an
application layer protocol. The file transfer takes place over TCP.
TELNET is Terminal 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 machine over
TCP.
3.2 Procedure:
3.2.1 How to Create Scenario & Generate Traffic:
 Create Scenario: “Simulation  New  Internetworks”.
3.2.2 Sample Inputs:
FTP, Database, Voice, HTTP, Email, Peer to Peer and Video are the traffic types available as
options in NetSim. To model other applications the “Custom” option is available. TELNET
application has been modeled in NetSim by using custom traffic type. Packet Size and Packet
Inter Arrival Time for TELNET application is shown below:
Packet Size
Distribution Constant
Packet Size (Bytes) 1460
Packet Inter Arrival Time
Distribution Constant
Packet Inter Arrival Time (µs) 1500
Fig 1: The Network Scenario
In this experiment, 8 Wired Nodes and 3 Routers need to be clicked & dropped onto the
Simulation environment. Wired Nodes A, B and C are connected to Router I. Wired Nodes E,
F, G and H are connected to Router K. Wired Node D is connected to Router J. Router I and
Router K are connected to Router J. The network scenario is shown in above fig 1.
Then follow these steps:
Sample 1: FTP Application from Wired Node D to Wired Node E.
Sample 2: FTP Application from Wired Node D to Wired Node E. TELNET Application
from Wired Node A to Wired Node F.
Sample 3: FTP Application from Wired Node D to Wired Node E. TELNET Application
from Wired Node A to Wired Node F. TELNET Application from Wired Node B to Wired
Node G.
Sample 4: FTP Application from Wired Node D to Wired Node E. TELNET Application
from Wired Node A to Wired Node F. TELNET Application from Wired Node B to Wired
Node G. TELNET Application from Wired Node C to Wired Node H.
Note: Select “custom” for “TELNET” application
TELNET
FTP
Inputs for the Sample experiment are given below:
Set the following properties for all wired links.
Wired Node Properties:
Set the following properties for Wired Node D if application type is FTP and destination is
Wired Node E. Set the following properties for Wired Node A if application type is TELNET
and destination is Wired Node F.
Node Properties Wired Node D Wired Node A
Transport Layer Properties
TCP Enable Enable
Application Properties: (set the application property as per screenshot)
Application Type FTP Custom(for TELNET)
Source ID Wired Node D Wired Node A
Destination ID Wired Node E Wired Node F
Size
Distribution Constant Constant
Size (Bytes) 10000000 1460
Inter Arrival Time
Distribution Constant Constant
Inter Arrival Time 10 sec 1500 (µs)
Router Properties: Accept default properties for the Router.
Wired Link Properties: Set the following properties for all Wired Links.
Link Properties All Wired Links
Uplink Speed (Mbps) 1
Downlink Speed (Mbps) 1
Uplink BER No Error
Downlink BER No Error
Simulation Time - 100 Sec
Upon completion of the experiment “Save” the experiments for comparisons which is carried
out in the “Analytics” section and export to .csv to save the results.
3.2.3 Output:
Open the Excel Sheet and note down the various throughputs as shown in the table below.
These throughput values are available under application metrics in the metrics screen of
NetSim.
Experiment
Number
Source Destination Application Throughput
1 Wired Node D Wired Node E FTP 0.842595
2 Wired Node D Wired Node E FTP 0.662840
2 Wired Node A Wired Node F TELNET 0.257427
3 Wired Node D Wired Node E FTP 0.557720
3 Wired Node A Wired Node F TELNET 0.175550
3 Wired Node B Wired Node G TELNET 0.189917
4 Wired Node D Wired Node E FTP 0.486706
4 Wired Node A Wired Node F TELNET 0.146818
4 Wired Node B Wired Node G TELNET 0.142262
4 Wired Node C Wired Node H TELNET 0.144949
3.2.3.1 Graph I
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1 FTP 1 FTP + 1 TELNET 1 FTP + 2 TELNET 1 FTP + 3 TELNET
FTPThroughput(Mbps)
FTP Throughput
3.2.3.2 Graph II
3.2.4 Inference
From Graph I it can be inferred that FTP throughput decreases as the number of
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.
From Graph II it can be inferred that TELNET throughput of Wired Node 1 decreases as
the number 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 link 5.
Hence as the overall TELNET traffic over wired link 5 increases, the TELNET throughput
of Wired Node 1 decreases.
0
0.05
0.1
0.15
0.2
0.25
0.3
1 FTP + 1 TELNET 1 FTP + 2 TELNET 1 FTP + 3 TELNET
TELNETThroughput(Mbps) TELNET Throughput of Wired Node 1
4.Network Socket Programming
4.1 Objective
Study of Socket Programming and Client – Server model
4.2 Theory:
The socket is a fundamental concept to the operation of TCP/IP 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 socket
on other.
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 sockets).
There is a receiver (TCP) server, which listens to the sender (TCP) client communications.
There can be two-way communication.
4.3 Algorithm:
Server:
1. Create a socket using address family (AF_INET), type (SOCK_STREM) and protocol
(TCP)
2. Initialize the address family, port no and IP address to communicate using sockets
3. Bind a local address and port number with a socket
4. Listen for an incoming socket connection
5. Accept an incoming connection attempt on a socket
6. Receive an incoming message
7. Write that incoming message to Output.txt
8. Send ACK to received socket
9. Call step 5 to receive the message once again
10. Close file
11. Close socket
Client:
1. Create a socket using address family (AF_INET), type (SOCK_STREM) and protocol
(TCP)
2. Initialize the address family, port no and IP address to communicate using sockets
3. Establish Connection with destination IP
4. Send the data using the socket id
5. Close the socket connection
4.4 Procedure:
Step:1
To begin with the experiment, open NetSim
Click on Programming from the menu bar and select PC to PC Communication and then
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. Follow the steps
 Under Input there are two things,
1. When Operation is Client, then the Server’s IP Address (Ex: 192.168.1.2) should
be given in the Server IP Address field.
Select Mode
Select Protocol
Select Operation
Click Run to start
transmissionClick here to view Concept,
Algorithm, and Pseudo Code
& Flowchart
2. When Operation is Server, then the Server’s IP Address (Ex: 192.168.1.2) would
be automatically filled in the Local IP Address field.
If the Operation is Server, the scenario will be obtained as shown below,
If the Operation is Client, the scenario will be obtained as shown below,
Server
Side
Client
Side
Step:2
TCP
 First the Server should click on the Run button after which the Client should click on
the Run button to Create the socket
 Client should click on the Connect button to establish the connection with server.
 The Client should click on the Send button to transmit the data to the Server.
 The Client should click on the Close button to terminate the Connection with Server.
 If the Data is successfully transmitted then the Sent Data would be Received in the
Server System.
UDP
 First the Server should click on the Run button after which the Client should click on
the Run button to Create the socket
 The Client should click on the Send button to transmit the data to the Server.
 The Client should click on the Close button to terminate the Connection with Server.
 If the Data is successfully transmitted then the Sent Data would be Received in the
Server System.
Enter Destination
IP Address Enter data to be
transmitted
4.4.1 Result:
User Mode (TCP)
For user to write their own C Code in NetSim and check the result, click on Interface
Source Code (present in Help in the left pane).
Open Dev C++ or any GNU C compiler based IDK and copy the code from the Interface
Source Code.
In User Mode, the user needs to edit the Interface Source Code at the following location.
int fnTcpServer()
{
// Write your own code here
return 0;
}
So the user needs to add the user code, create exe and attach it with NetSim to run.
The User code which is to be added is given below
int fnTcpServer()
{
/////* User code part start */
nSocketfd =(int) socket(AF_INET,SOCK_STREAM, 0);
serv_addr.sin_family = AF_INET;
serv_addr.sin_port = htons(SERVER_PORTNUMBER);
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
Received
data
nBindfd = bind(nSocketfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr));
#ifndef _NETSIM_SAMPLE
nListenfd = listen(nSocketfd, 5);
#else
nListenfd = listen(nSocketfd, 1);
#endif
nServerLen = sizeof(serv_addr);
if (fnWriteOutput() == 1)
{ /*if socket creation,bind and listen failed function will terminate*/
closesocket(nSocketfd);
return 0;
}
#ifndef _NETSIM_SAMPLE
nNewsocketfd =(int) accept(nSocketfd, (struct sockaddr *) &cli_addr,
&nServerLen);
nLoopCount++;
memset(szData, 0, sizeof(szData)); /*Clear the array*/
nReceivedbytes =(int) recv(nNewsocketfd, szData, sizeof(szData), 0);
fnWriteOutput();
nSendbytes =(int) send(nNewsocketfd, pszBuffer, strlen(pszBuffer), 0);
#else
while (1)
{
nNewsocketfd =(int) accept(nSocketfd, (struct sockaddr *) &cli_addr,
&nServerLen);
nLoopCount++;
memset(szData, 0, sizeof(szData)); /*Clear the array*/
nReceivedbytes =(int) recv(nNewsocketfd, szData, sizeof(szData), 0);
fnWriteOutput();
nSendbytes =(int) send(nNewsocketfd, pszBuffer, strlen(pszBuffer), 0);
if( nTCPServerCloseFlag == 1) /*break the loop when user send close the
connection*/
break;
}
#endif
closesocket(nSocketfd);
////* User code part end */
return 0;
}
User Mode (UDP)
For user to write their own C Code in NetSim and check the result, click on Interface
Source Code (present in Help in the left pane).
Open Dev C++ or any GNU C compiler based IDK and copy the code from the Interface
Source Code.
In User Mode, the user needs to edit the Interface Source Code at the following location.
int fnUdpServer()
{
// Write your own code here
return 0;
}
So the user needs to add the user code, create exe and attach it with NetSim to run.
The User code which is to be added is given below
int fnUdpServer()
{
/////* User code part start */
nSocketfd = (int)socket(AF_INET,SOCK_DGRAM, 0); /*Server side socket
creation*/
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
serv_addr.sin_port = htons(SERVER_PORTNUMBER); /* Server port number 6000*/
nServerLen = sizeof(serv_addr);
nBindfd = bind(nSocketfd, (struct sockaddr *) &serv_addr,
sizeof(serv_addr));
fnWriteOutput();
#ifndef _NETSIM_SAMPLE
memset(szData, 0, sizeof(szData)); //Clear the array
nReceivedbytes = recvfrom(nSocketfd, szData, sizeof(szData), 0,(struct
sockaddr *) &serv_addr, &nServerLen);
fnWriteOutput();
#else
while(1)
{
memset(szData, 0, sizeof(szData)); //Clear the array
nReceivedbytes = recvfrom(nSocketfd, szData, sizeof(szData), 0,(struct
sockaddr *) &serv_addr, &nServerLen);
fnWriteOutput();
}
#endif
closesocket(nSocketfd);
/////* User code part end */
return 0;
}
Create .exe file (Appendix 2: Creating .exe file using Dev C++)
In the left panel, select the Mode as User. Select the .exe file created above.
Repeat the steps performed for Sample Mode and click Run.
So presently NetSim will execute code written by the user and will display the result
graphically.
In case of any error, “ERROR IN USER CODE” message will be displayed.
Note- How to practice this experiment without using NetSim
Users who do not have a licensed version of NetSim in their PC's, can practice as explained
below.
First, run the exercise in sample mode. The user would see that an Input.txt file is created in
Win OS temp folder (this can be reached by typing %temp%/NetSim in Windows run
window). This input file should be read by the user code and it should generate an Output.txt.
This Output.txt file is read by NetSim and shown graphically to the user.
User can follow the steps provided in Appendix 1: Programming exercise - How to practice
without NetSim.
Given below are sample Input.txt and Output.txt files for this experiment for users to verify
& validate their code. User must run the exe at both client and server and use the respective
Input.txt file. Inside Input.txt file at Client system, use the server system IP address in
“Destination IP Address” and client system IP address instead of “192.168.0.147:-Hello
World”
For TCP
Input.txt file contents at Server system
Protocol=TCP
Operation=Server
Input.txt file contents at Client system
Protocol=TCP
Operation=Client
Destination IP Address=192.168.0.130
192.168.0.147:-Hello World
Output.txt file contents at Server system
Socket Created
Bind Succeed
Listen Succeed
For UDP
Input.txt file contents at Server system
Protocol=UDP
Operation=Server
Input.txt file contents at Client system
Protocol=UDP
Operation=Client
Destination IP Address=192.168.0.130
192.168.0.147:-Hello World
Output.txt file contents at Server
system
Socket Created
Bind Succeed
5.Simulating a three node point-to-point
network and applying relevant applications
over TCP and UDP
5.1 Objective:
Simulate a three node point-to-point network with the links connected as follows:
n0  n2, n1 n2 and n2  n3. Apply TCP agent between n0-n3 and UDP between n1-n3.
Apply relevant applications over TCP and UDP agents changing the parameter and determine
the number of packets sent by TCP / UDP. (n0, n1 and n3 are nodes and n2 is router).
5.2 Theory:
TCP:
TCP recovers data that is damaged, lost, duplicated, or delivered out of order by the internet
communication system. This is achieved by assigning a sequence number to each octet
transmitted, and requiring a positive acknowledgment (ACK) from the receiving TCP. If the
ACK is not received within a timeout interval, the data is retransmitted. At the receiver side
sequence number is used to eliminate the duplicates as well as to order the segments in
correct order since there is a chance of “out of order” reception. Therefore, in TCP no
transmission errors will affect the correct delivery of data.
UDP:
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.
5.3 Procedure:
To Create Scenario, goto Simulation  New  Internetworks.
Click & drop Router, Wired Nodes and Application onto the Simulation Environment
from tool bar as shown below.
5.3.1 Sample Inputs:
Sample 1
Set the properties for the devices and links as shown below:
Wired Node Properties:
Wired Node Properties Wired Node B Wired Node C
Transport Layer Properties
TCP Enable Disable
UDP Disable Enable
Application Properties:
Application Type Custom Custom
Source ID 2(Wired Node B) 3(Wired Node C)
Destination ID 4(Wired Node D) 4(Wired Node D)
Packet Size
Distribution Constant Constant
Value(Bytes) 1460 1460
Inter Arrival Time
Distribution Constant Constant
Value(µs) 10000 10000
To add an application, click add button in application property
Router Properties:
Accept the default properties for Router.
Wired Link Properties:
Accept the default properties for all Wired Links.
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 and Application.
 Then click on Run simulation).
Sample 1: Wired Node B and Wired Node C transmit data to Wired Node D with the Packet
Inter Arrival Time as 10000 µs.
Likewise do the Sample 2 and Sample 3 by decreasing the Packet Inter Arrival Time as
5000 µs and 2500 µs respectively.
(Note: “Packet Inter Arrival Time (µs)” field is available in Application Properties)
Simulation Time - 100 Sec
(Note: The Simulation Time can be selected only after doing the following two tasks,
 Set the properties for Wired Nodes, Router, Wired Links and Application.
 Then click on Run simulation).
5.3.2 Comparison Chart:
(Note: The Number of Segments Sent, Segments Received and Datagram Sent, Datagram
Received will be available in the TCP Metrics and UDP Metrics of “Performance Metrics”
screen of NetSim)
5.3.2.1 Graph I
(Note: The “Packets transmitted successfully” for TCP is Segments Received and for UDP
is Datagram Received of the destination node i.e., Wired Node 3)
Below Graph Shows Number of packets transmitted successfully in TCP and UDP
5.3.2.2 Graph II
(Note: To get the “No. of packet lost”, For TCP, get the difference between Segments Sent
and Segments Received and for UDP, get the difference between Datagram Sent and
Datagram Received)
Below Graph Shows Number of lost packets in TCP and UDP
0
5000
10000
15000
20000
25000
30000
35000
40000
45000
Exp 1 Exp 2 Exp 3
PacketsTransmittedSuccessfully
Inter arrival time (Micro Sec)
TCP vs UDP
TCP
UDP
0
10
20
30
40
50
60
70
80
90
100
Exp 1 Exp 2 Exp 3
No.ofPacketLost
Experiment List
TCP
UDP
5.3.3 Inference:
Graph I, shows that the number of successful packets transmitted in TCP is greater than (or
equal to) UDP. Because, when TCP transmits a packet containing data, it puts a copy on a
retransmission queue and starts a timer; when the acknowledgment for that data is received,
the segment is deleted from the queue. If the acknowledgment is not received 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 not retransmit 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.
6.Stop & Wait Protocol
Objective: Write a C/C++ program to implement stop & wait protocol.
6.1 Theory:
Stop and Wait is a reliable transmission flow control protocol. This protocol works only in
Connection Oriented (Point to Point) Transmission. The Source node has window size of
ONE. After transmission of a frame the transmitting (Source) node waits for an
Acknowledgement from the destination node. If the transmitted frame reaches the destination
without error, the destination transmits a positive acknowledgement. If the transmitted frame
reaches the Destination with error, the receiver destination does not transmit an
acknowledgement. If the transmitter receives a positive acknowledgement it transmits the
next frame if any. Else if its acknowledgement receive timer expires, it retransmits the same
frame.
6.2 Algorithm:
Start with the window size of 1 from the transmitting (Source) node.After transmission of a
frame the transmitting (Source) node waits for a reply (Acknowledgement) from the
receiving (Destination) node.
If the transmitted frame reaches the receiver (Destination) without error, the receiver
(Destination) transmits a Positive Acknowledgement.
If the transmitted frame reaches the receiver (Destination) with error, the receiver
(Destination) do not transmit acknowledgement.
If the transmitter receives a positive acknowledgement it transmits the next frame if any. Else
if the transmission timer expires, it retransmits the same frame again.
If the transmitted acknowledgment reaches the Transmitter (Destination) without error, the
Transmitter (Destination) transmits the next frame if any.
If the transmitted frame reaches the Transmitter (Destination) with error, the Transmitter
(Destination) transmits the same frame.
This concept of the Transmitting (Source) node waiting after transmission for a reply from
the receiver is known as STOP and WAIT.
6.3 Procedure:
Step 1:
To begin with the experiment, open NetSim
Click on Programming from the menu bar and select Transmission Flow Control. The
scenario is as shown in the following two figures.
Next the following window appears and its description is given.
When you select the User mode, you have to write your own program in C/C++, compile and
link to NetSim software for validation. Click on the F1 (help) icon for details on how to
proceed with your own code.
Continue with the steps as given for sample mode. As soon as you begin to enter the input
data file the following window appears and you select the input data file from where you
have stored.
Click Run to execute program
Click here to view concept, algorithm,
pseudo Code & flow chart
Enter input & error rate
Stop & Wait
Select Mode
6.4 Result:
Click Run button to view the output.
6.5 Inference:
Due to increase in the error rate, no of errored packets also increase. If errored packets
increase no of retransmitted packets also increase.
Step 2:
For user to write their own C Code in NetSim and check the result, click on Interface
Source Code (present in Help in the left pane).
Open Dev C++ or any GNU C compiler based IDK and copy the code from the Interface
Source Code.
The user needs to edit the Interface Source Code at the following location.
void stopandwait(int errrate)
{
Data file
that is added
Output table
// Write your own code here
}
So the user needs to add the user code, create exe and attach it with NetSim to run.
The User code which is to be added is given below
void stopandwait(int errrate)
{
/////* User code part start */
// Repeat the loop until transmission list of the transmitting
// node becomes empty
while(nodelist_sw->txframe != NULL)
{
// Get the current transmitting frame reference
transframe_sw = ret_txframe_SW ();
// Write the content into the output file. Data Value is written
//into the file
fprintf(fp_sw,"DT>%d>%s>%s>n",transframe_sw->iframe,transframe_sw-
>szsrcaddr,transframe_sw->szdestaddr);
/*
Call the default function defined in the header file main1.h
Store the return value to the local variable iret_sw.
The Passed arguments
1. errrate -- This is the variable passed to the function (got from
the function call of the retErrorrate)
2. transframe_sw -- This is Eth_frame_sw reference that has the
Transmitting frame got from the function call ret_txframe_SW
*/
iret_sw=intro_error_SW(errrate,transframe_sw);
// Write the content into the output file. Error value is written
into
//the file
fprintf(fp_sw,"EV>%d>%s>%s>n",iret_sw,transframe_sw-
>szsrcaddr,transframe_sw->szdestaddr);
// Check if the frame is Positive or Negative
if(iret_sw == 0)// Positive acknowledgment in the network
{
// Form the Ack frame according to the iret_sw value
form_ack_SW (transframe_sw,1);// Positive Acknowledgement
// Call the ret_ackframe_sw function and get the
acknowledgement frame
//reference from the tranmitting list of the receiving node
ackframe_sw=ret_ackframe_sw ();
// Write the content into the file. Positive Ack value
fprintf(fp_sw,"ACK>POS>%s>%s>n",ackframe_sw-
>szsrcaddr,ackframe_sw->szdestaddr);
// Acknowledgement frame is made so delete the transmitted
frame from
//the transmitting list of the source node
del_frame_SW(transframe_sw ->ipack,transframe_sw ->iframe);
// User defined function call to delete the Acknowledgement
frame
del_ackframe_sw ();
}
}
/////* User code part end */
}
Create .exe file (Appendix 2: Creating .exe file using Dev C++)
In the left panel, select the Mode as User. Select the .exe file created above.
Select Stop and Wait and the Bit Error Rate (No Error or Error). Create a small text file
(within 15000 bytes) and set it as input.
Click Run.
So presently NetSim will run Stop and Wait code which is written by the user and will
display the result graphically. In case of any error, “ERROR IN USER CODE” message will
be displayed.
NOTE: Please insert the correct code according to the algorithm selected. The codes for other
algorithm are provided in NetSim Installation CD.
Note- How to practice this experiment without using NetSim:
Users who do not have a licensed version of NetSim in their PC's, can practice as explained
below.
First, run the exercise in sample mode. The user would see that an Input.txt file is created in
Win OS temp folder (this can be reached by typing %temp%/NetSim in Windows run
window). This input file should be read by the user code and it should generate an Output.txt.
This Output.txt file is read by NetSim and shown graphically to the user.
User can follow the steps provided in Appendix 1: Programming exercise - How to practice
without NetSim.
Given below are sample Input.txt and Output.txt files for this experiment for users to verify
& validate their code. The Output.txt file will vary based on the Data_file. In this case, the
Data_File file contains the text “a”.
Input.txt file contents
Algorithm=Stop_and_Wait
Data_File=C:UsersNirjharDesktopdata.txt>
BER=0
*Note- Create any file of size <15000 Byte. Type the location of the file in Data_File.
Output.txt file contents
DT>1>node1>node2>
EV>0>node1>node2>
ACK>POS>node2>node1>
*Note- Output.txt content will vary depending on the file contents.
7.Go Back N Protocol
Objective: Write a C/C++ program to implement Go Back N protocol.
7.1 Theory:
Go Back N is a connection oriented transmission. The sender transmits the frames
continuously. Each frame in the buffer has a sequence number starting from 1 and increasing
up to the window size. The sender has a window i.e. a buffer to store the frames. This buffer
size is the number of frames to be transmitted continuously. The size of the window depends
on the protocol designer.
7.2 Operations:
A station may send multiple frames as allowed by the window size.
Receiver sends an negative ACK if frame i has an error. After that, the receiver discards all
incoming frames until the frame with error is correctly retransmitted.
If sender receives a negative ACK it will retransmit frame i and all packets i+1, i+2, ... which
have been sent, but not been acknowledged.
7.3 Algorithm:
The source node transmits the frames continuously.
Each frame in the buffer has a sequence number starting from 1 and increasing up to the
window size.
The source node has a window i.e. a buffer to store the frames. This buffer size is the number
of frames to be transmitted continuously.
The size of the window depends on the protocol designer.
For the first frame, the receiving node forms a positive acknowledgement if the frame is
received without error.
If subsequent frames are received without error (up to window size) cumulative positive
acknowledgement is formed.
If the subsequent frame is received with error, the cumulative acknowledgment error-free
frames are transmitted. If in the same window two frames or more frames are received with
error, the second and the subsequent error frames are neglected. Similarly even the frames
received without error after the receipt of a frame with error are neglected.
The source node retransmits all frames of window from the first error frame.
If the frames are errorless in the next transmission and if the acknowledgment is error free,
the window slides by the number of error-free frames being transmitted.
If the acknowledgment is transmitted with error, all the frames of window at source are
retransmitted, and window doesn‟t slide.
This concept of repeating the transmission from the first error frame in the window is called
as GOBACKN transmission flow control protocol.
7.4 Procedure
Step 1:
To begin with the experiment, open NetSim.
Click on Programming from the menu bar and select Transmission Flow Control.
The scenario will be as shown in the following two figures.
Next the following window appears and its description is given.
When you select the User mode, you have to write your own program in C/C++, compile and
link to NetSim software for validation. Click on F1 (help) for details on how to proceed with
your own code.
Continue with the steps as given for sample mode. As soon as you begin to enter the input
data file the following window appears and you select the input data file from where you
have stored.
Click here to view Concept, Algorithm, Pseudo
Code and Flow chart
Click Run to
execute program
Enter input & bit error rate
Go Back N
Select Mode
Data file that is added
7.5 Result:
Click Run to view the output.
Step 2:
For user to write their own C Code in NetSim and check the result, click on Interface
Source Code (present in Help in the left pane).
Open Dev C++ or any GNU C compiler based IDK and copy the code from the Interface
Source Code.
The user needs to edit the Interface Source Code at the following location.
void GoBackN(int derrValue)
{
// Write your own code here
}
So the user needs to add the user code, create exe and attach it with NetSim to run.
The User code which is to be added is given below
void GoBackN(int derrValue)
{
/////* User code part start */
// This szfilename variable has the output file path where the user has
to
// write his output
framelist = nodelist->txframe; // Store Transmission list of the source
//node to the local Eth_frame variable.
// Repeat the loop until transmission list becomes empty
while (nodelist->txframe != NULL) {
ialreadyerror = 0;// Already Error flag value as 0
// Call the default function defined in the main.h.
isliindex = slidingcount();// Returns the number of frames to be
Output table
//transmitted in the current window.
// Write the content into the output file. Slinding Window count
// is written into the file.
fp = fopen(szfilename, "a+");
fprintf(fp, "CNT>%d>FRAMES>TRANSMIT>n", isliindex);
fclose(fp);
// Get the first frame from the transmission list
transframe = rettxframe(-1, -1);
// Make the looping for isliindex variable
for (iloop = 0; iloop < isliindex; iloop++) {
// Write the content into the output file. Data Value is
// written into the file.
fp = fopen(szfilename, "a+");
fprintf(fp, "DT>%d>%s>%s>n", transframe->iframe,
transframe->szsrcaddr, transframe->szdestaddr);
fclose(fp);
/*
Call the default function defined in the header file main1.h
Store the return value to the local variable iret.
The Passed arguments
1. derrValue -- This is the variable passed to the function
(got from the function call of the retErrorrate)
2. transframe -- This is Eth_frame reference that has the
Transmitting frame got from the function call ret_txframe
*/
iret = intro_error(derrValue, transframe);
// Write the content into the output file. Error value is
// written into the file
fp = fopen(szfilename, "a+");
fprintf(fp, "EV>%d>%s>%s>n", iret, transframe->szsrcaddr,
transframe->szdestaddr);
fclose(fp);
if (iret == 0)//No Error condition
{
if (ialreadyerror == 0) // Check for the Error Flag is 0
{
formack(transframe); // Means Cumulative
acknowledgement
// frame formation
}
else {
}
} else
// Error Condition
ialreadyerror = 1; // Make the Already Error flag
value as 1.
// Call the user defined function to get the next
transmission
// frame of the transmitting node.
transframe = rettxframe(transframe->ipack, transframe->iframe);
}
// Call the user defined function to get the acknowledgement frame
ackframe = ret_ackframe();
// Store the current transmission list reference of the
transmitting
// node from the local variable framelist.
nodelist->txframe = framelist;
if (ackframe != NULL)// There is some positive acknowledgement
formed
{
// Write the content into the file. Positive Ack value
fp = fopen(szfilename, "a+");
fprintf(fp, "ACK>POS>%s>%s>n", ackframe->szsrcaddr,
ackframe->szdestaddr);
fclose(fp);
for (iloop = 0; iloop < ackframe->iseq; iloop++) {
// Call the function to delete the frame from the
transmission
// list of the transmitting node.
framelist = deltxframe();
}
// Write the content into the file. Number of frames
deleted
// from the source node.
fp = fopen(szfilename, "a+");
fprintf(fp, "DEL>%d>FRAME>DELETED>n", ackframe->iseq);
fclose(fp);
}
// Call the user defined function to delete the acknowledgement
frame
//from the transmission list of the destination node.
del_ackframe();
}
/////* User code part end */
}
Create .exe file (Appendix 2: Creating .exe file using Dev C++)
In the left panel, select the Mode as User. Select the .exe file created above.
Select Go Back N and the Bit Error Rate (No Error or Error). Create a small text file (within
15000 bytes) and set it as input.
Click Run.
So presently NetSim will run Go Back N code which is written by the user and will display
the result graphically.
In case of any error, “ERROR IN USER CODE” message will be displayed.
NOTE: Please insert the correct code according to the algorithm selected. The codes for other
algorithm are provided in NetSim Installation CD.
Note- How to practice this experiment without using NetSim:
Users who do not have a licensed version of NetSim in their PC's, can practice as explained
below.
First, run the exercise in sample mode. The user would see that an Input.txt file is created in
Win OS temp folder (this can be reached by typing %temp%/NetSim in Windows run
window). This input file should be read by the user code and it should generate an Output.txt.
This Output.txt file is read by NetSim and shown graphically to the user.
User can follow the steps provided in Appendix 1: Programming exercise - How to practice
without NetSim.
Given below are sample Input.txt and Output.txt files for this experiment for users to verify
& validate their code. The Output.txt file will vary based on the Data_file. In this case, the
Data_File file contains the text “a”.
Input.txt file contents
Algorithm=Go_Back_N
Data_File=C:UsersNirjharDesktopdata.txt>
BER=0
*Note- Create any file of size <15000 Byte. Type the location of the file in Data_File.
Output.txt file contents
CNT>1>FRAMES>TRANSMIT>
DT>1>node1>node2>
EV>0>node1>node2>
ACK>POS>node2>node1>
DEL>1>FRAME>DELETED>
*Note- Output.txt content will vary depending on the file contents
8.Selective Repeat Protocol
Objective: Write a C/C++ program to implement Selective Repeat protocol.
8.1 Theory:
Selective repeat is Similar to Go Back N. However, the sender only retransmits that frame for
which a negative ACK is received
Advantage over Go Back N:
 Fewer retransmissions.
Disadvantages:
 More complexity at sender and receiver.
 Receiver may receive frames out of sequence.
Operations:
A station may send multiple frames as allowed by the window size.
Receiver sends a negative ACK if frame i has an error. After that, the receiver does not
discard all incoming frames as in Go Back N.
If sender receives a negative ACK it will retransmit only frame i which is the error frame.
8.2 Algorithm:
The source node transmits the frames continuously.
Each frame in the buffer has a sequence number starting from 1 and increasing up to the
window size.
The source node has a window i.e. a buffer to store the frames. This buffer size is the number
of frames to be transmitted continuously.
The receiver has a buffer to store the received frames. The size of the buffer depends upon
the window size defined by the protocol designer.
The size of the window depends according to the protocol designer.
The source node transmits frames continuously till the window size is exhausted. If any of
the frames are received with error only those frames are requested for retransmission (with a
negative acknowledgement)
If all the frames are received without error, a cumulative positive acknowledgement is sent.
If there is an error in frame 3, an acknowledgement for the frame 2 is sent and then only
Frame 3 is retransmitted. Now the window slides to get the next frames to the window.
If acknowledgment is transmitted with error, all the frames of window are retransmitted. Else
ordinary window sliding takes place. (* In implementation part, Acknowledgment error is not
considered)
If all the frames transmitted are errorless the next transmission is carried out for the new
window.
This concept of repeating the transmission for the error frames only is called Selective
Repeat transmission flow control protocol.
8.3 Procedure
Step 1:
To begin with the experiment, open NetSim.
Click on Programming from the menu bar and select Transmission Flow Control.
Next the following window appears and its description is given.
When you select the User mode, you have to write your own program in C/C++, compile and
link to NetSim software for validation. Click on the F1 (help) for details on how to proceed
with your own code.
Continue with the steps as given for sample mode. As soon as you begin to enter the input
data file the following window appears and you select the input data file from where you
have stored.
Click here to view Concept, Algorithm, and
Pseudo Code & Flow chart
Click Run to execute
the program
Enter input & bit error rate
Selective Repeat
Select mode
Data file that is added
8.4 Result:
Click Run to view the output.
Step 2:
For user to write their own C Code in NetSim and check the result, click on Interface
Source Code (present in Help in the left pane).
Open Dev C++ or any GNU C compiler based IDK and copy the code from the Interface
Source Code.
The user needs to edit the Interface Source Code at the following location.
void SelRepeat(int nErrValue)
{
// Write your own code here
}
So the user needs to add the user code, create exe and attach it with NetSim to run.
The User code which is to be added is given below
void SelRepeat(int nErrValue)
{
/////* User code part start */
// This szfilename_SR variable has the output file path where the user
has to write his output
framelist_SR = nodelist_SR->txframe;// Store Transmission list of the
source node to the local Eth_frame_SR variable.
Output table
for(iloop_SR=0;iloop_SR<7;iloop_SR++)
{
szBuffer_SR[iloop_SR] = 0;
}
// Make the nCurrentFrame_SR as 0, That is the first frame of the window
is going to be transmitted
nCurrentFrame_SR = 0;
// Repeat the loop until all the frames has been transmitted in the
network
while(nodelist_SR->txframe != NULL)
{
icount_SR = 0;
// Get the first frame for the transmission
transframe_SR=retseltxframe(-1,-1);
isliindex_SR = fnFrameCount_SR();// Get the count of number of
frames to be transmitted in the medium
// Write the content into the file
fp_SR = fopen(szfilename_SR,"a+");
fprintf(fp_SR,"CNT>%d>FRAMES>TRANSMIT>n",isliindex_SR);
fclose(fp_SR);
ialreadyerror_SR = 0; // A flag value to say the error has
been introduced in the network
for(iloop_SR=0;iloop_SR<isliindex_SR;iloop_SR++)
{
// Store the temporary packet number,frame number in the
local variable
ipackno_SR=transframe_SR->ipack;
iframeno=transframe_SR->iframe;
// Open the file in appending mode
fp_SR = fopen(szfilename_SR,"a+");
fprintf(fp_SR,"DT>%d>%s>%s>n",transframe_SR-
>iframe,transframe_SR->szsrcaddr,transframe_SR->szdestaddr);
fclose(fp_SR);
// Call the inbuild function to make error in the frame
iret_SR = intro_error_SR(nErrValue,transframe_SR);
fp_SR = fopen(szfilename_SR,"a+");
fprintf(fp_SR,"EV>%d>%s>%s>n",iret_SR,transframe_SR-
>szsrcaddr,transframe_SR->szdestaddr);
fclose(fp_SR);
if(iret_SR == 0)// No Error in the frame
{
// Make the frame has been received.
szBuffer_SR[(transframe_SR->iseq) - 1] = 1;
}
// Call the function to get the next transmission frame
transframe_SR=retseltxframe(ipackno_SR,iframeno);
}
// Store the transmission back to the original position
nodelist_SR->txframe = framelist_SR;
// Formation of the acknowledgement
formselack();
// Get the acknowledgement frame of the transmission
ackframe_SR = retselackframe_SR();
if(ackframe_SR == NULL)
{
}
else// Some frames has been received
{
fp_SR = fopen(szfilename_SR,"a+");
fprintf(fp_SR,"ACK>POS>%s>%s>n",ackframe_SR-
>szsrcaddr,ackframe_SR->szdestaddr);
fclose(fp_SR);
// Loop to delete the frames
for(iloop_SR=0;iloop_SR<ackframe_SR->iseq;iloop_SR++)
{
framelist_SR=delseltxframe();
}
fp_SR = fopen(szfilename_SR,"a+");
fprintf(fp_SR,"DEL>%d>FRAME>DELETED>n",ackframe_SR->iseq);
fclose(fp_SR);
}
}
/////* User code part end */
}
Create .exe file (Appendix 2: Creating .exe file using Dev C++)
In the left panel, select the Mode as User. Select the .exe file created above.
Select Selective Repeat and the Bit Error Rate (No Error or Error). Create a small text file
(within 15000 bytes) and set it as input.
Click Run.
So presently NetSim will run Selective Repeat code which is written by the user and will
display the result graphically.
In case of any error, “ERROR IN USER CODE” message will be displayed.
NOTE: Please insert the correct code according to the algorithm selected. The codes for other
algorithm are provided in NetSim Installation CD.
Note- How to practice this experiment without using NetSim:
Users who do not have a licensed version of NetSim in their PC's, can practice as explained
below.
First, run the exercise in sample mode. The user would see that an Input.txt file is created in
Win OS temp folder (this can be reached by typing %temp%/NetSim in Windows run
window). This input file should be read by the user code and it should generate an Output.txt.
This Output.txt file is read by NetSim and shown graphically to the user.
User can follow the steps provided in Appendix 1: “Programming exercise - How to practice
without NetSim”.
Given below are sample Input.txt and Output.txt files for this experiment for users to verify
& validate their code. The Output.txt file will vary based on the Data_file. In this case, the
Data_File file contains the text “a”.
Input.txt file contents
Algorithm=Selective_Repeat
Data_File=C:UsersNirjharDesktopdata.txt>
BER=0
*Note- Create any file of size <5000 Byte. Type the location of the file in Data_File.
Output.txt file contents
CNT>1>FRAMES>TRANSMIT>
DT>1>node1>node2>
EV>0>node1>node2>
ACK>POS>node2>node1>
DEL>1>FRAME>DELETED>
*Note- Output.txt content will vary depending on the file contents.
9.Study the throughputs of Slow start +
Congestion avoidance (Old Tahoe) and Fast
Retransmit (Tahoe) Congestion Control
Algorithms
9.1 Theory:
One of the important functions of a TCP Protocol is congestion control in the network. Given
below is a description of how Old Tahoe and Tahoe variants (of TCP) control congestion.
Old Tahoe:
Congestion can occur when data arrives on a big pipe (i.e. a fast LAN) and gets sent out
through a smaller pipe (i.e. a slower WAN). Congestion can also occur when multiple input
streams arrive at a router whose output capacity is less than the sum of the inputs. Congestion
avoidance is a way to deal with lost packets.
The assumption of the algorithm is that the packet loss caused by damaged is very small
(much less than 1%), therefore the loss of a packet signals congestion somewhere in the
network between the source and destination. There are two indications of packets loss: a
timeout occurring and the receipt of duplicate ACKs
Congestion avoidance and slow start are independent algorithms with different objectives.
But when congestion occurs TCP must slow down its transmission rate and then invoke slow
start to get things going again. In practice they are implemented together.
Congestion avoidance and slow start requires two variables to be maintained for each
connection: a Congestion Window (i.e. cwnd) and a Slow Start Threshold Size (i.e. ssthresh).
Old Tahoe algorithm is the combination of slow start and congestion avoidance. The
combined algorithm operates as follows,
1. Initialization for a given connection sets cwnd to one segment and ssthresh to 65535
bytes.
2. When congestion occurs (indicated by a timeout or the reception of duplicate ACKs),
one-half of the current window size (the minimum of cwnd and the receiver‟s advertised
window, but at least two segments) is saved in ssthresh. Additionally, if the congestion is
indicated by a timeout, cwnd is set to one segment (i.e. slow start).
3. When new data is acknowledged by the other end, increase cwnd, but the way it increases
depends on whether TCP is performing slow start or congestion avoidance.
If cwnd is less than or equal to ssthresh, TCP is in slow start. Else TCP is performing
congestion avoidance. Slow start continues until TCP is halfway to where it was when
congestion occurred (since it recorded half of the window size that caused the problem in
step 2). Then congestion avoidance takes over.
Slow start has cwnd begins at one segment and be incremented by one segment every time an
ACK is received. As mentioned earlier, this opens the window exponentially: send one
segment, then two, then four, and so on. Congestion avoidance dictates that cwnd be
incremented by 1/cwnd, compared to slow start‟s exponential growth. The increase in cwnd
should be at most one segment in each round trip time (regardless of how many ACKs are
received in that RTT), whereas slow start increments cwnd by the number of ACKs received
in a round-trip time.
Tahoe (Fast Retransmit):
The Fast retransmit algorithms operating with Old Tahoe is known as the Tahoe variant.
TCP may generate an immediate acknowledgement (a duplicate ACK) when an out-of-order
segment is received out-of-order, and to tell it what sequence number is expected.
Since TCP does not know whether a duplicate ACK is caused by a lost segment or just a re-
ordering of segments, it waits for a small number of duplicate ACKs to be received. It is
assumed that if there is just a reordering of the segments, there will be only one or two
duplicate ACKs before the re-ordered segment is processed, which will then generate a new
ACK. If three or more duplicate ACKs are received in a row, it is a strong indication that a
segment has been lost. TCP then performs a retransmission of what appears to be the missing
segment, without waiting for a re-transmission timer to expire.
9.2 Procedure:
Go to Simulation  New  Internetworks
Sample Inputs:
Follow the steps given in the different samples to arrive at the objective.
Sample 1.a: Old Tahoe (1 client and 1 server)
In this Sample,
 Total no of Node used: 2
 Total no of Routers used: 2
The devices are inter connected as given below,
 Wired Node C is connected with Router A by Link 1.
 Router A and Router B are connected by Link 2.
 Wired Node D is connected with Router B by Link 3.
Set the properties for each device by following the tables,
Application Properties
Application Type Custom
Source_Id 4(Wired Node D)
Destination_Id 3(Wired Node C)
Packet Size
Distribution Constant
Value (bytes) 1460
Inter Arrival Time
Distribution Constant
Value (micro secs) 1300
Node Properties: In Transport Layer properties, set
TCP Properties
MSS(bytes) 1460
Congestion Control Algorithm Old Tahoe
Window size(MSS) 8
Router Properties: Accept default properties for Router.
Link Properties Link 1 Link 2 Link 3
Max Uplink Speed (Mbps) 8 10 8
Max Downlink Speed(Mbps) 8 10 8
Uplink BER 0.000001 0.000001 0.000001
Downlink BER 0.000001 0.000001 0.000001
Simulation Time - 10 Sec
Upon completion of simulation, “Save” the experiment.
(Note: The Simulation Time can be selected only after doing the following two tasks,
 Set the properties of Node, Router& Link
 Then click on Run Simulation button).
Sample 1.b: Tahoe (1 client and 1 server)
Open sample 1.a, and change the TCP congestion control algorithm to Tahoe (in Node
Properties). Upon completion of simulation, “Save” the experiment as sample 1.b.
Sample 2.a: Old Tahoe (2 clients and 2 servers)
In this Sample,
 Total no of Wired Nodes used: 4
 Total no of Routers used: 2
The devices are inter connected as given below,
 Wired Node A and Wired Node B are connected with Router C by Link 1 and Link 2.
 Router C and Router D are connected by Link 3.
 Wired Node E and Wired Node F are connected with Router D by Link 4 and Link 5.
 Wired Node A and Wired Node B are not transmitting data in this sample.
Set the properties for each device by following the tables,
Application Properties Application 1 Application 2
Application Type Custom
Source_Id 5 6
Destination_Id 1 2
Packet Size
Distribution Constant Constant
Value (bytes) 1460 1460
Inter Arrival Time
Distribution Constant Constant
Value (micro secs) 1300 1300
Node Properties: In Transport Layer properties, set
TCP Properties
MSS(bytes) 1460
Congestion Control Algorithm Old Tahoe
Window size(MSS) 8
Router Properties: Accept default properties for Router.
Link Properties Link 1 Link 2 Link 3 Link 4 Link 5
Max Uplink Speed
(Mbps)
8 8 10 8 8
Max Downlink Speed
(Mbps)
8 8 10 8 8
Uplink BER 0.000001 0.000001 0.000001 0.000001 0.000001
Downlink BER 0.000001 0.000001 0.000001 0.000001 0.000001
Simulation Time - 10 Sec
Upon completion of simulation, “Save” the experiment.
(Note: The Simulation Time can be selected only after doing the following two tasks,
 Set the properties of Node , Router & Link
 Then click on Run Simulation button).
Sample 2.b: Tahoe (2 clients and 2 servers)
Do the experiment as sample 2.a, and change the congestion control algorithm to Tahoe.
Upon completion of simulation, “Save” the experiment.
Sample 3.a: Old Tahoe (3 clients and 3 servers)
In this Sample,
 Total no of Nodes used: 6
 Total no of Routers used: 2
The devices are inter connected as given below,
 Wired Node A, Wired Node B & Wired Node C is connected with Router D by Link 1,
Link 2 & Link 3.
 Router D and Router E are connected by Link 4.
 Wired Node F, Wired Node G & Wired Node H is connected with Router E by Link 5,
Link 6 & Link 7.
 Wired Node A, Wired Node B and Wired Node C are not transmitting data in this sample.
Set the properties for each device by following the tables,
Application
Properties
Application 1 Application 2 Application 3
Application Type Custom
Source_Id 6 7 8
Destination_Id 1 2 3
Packet Size
Distribution Constant Constant Constant
Value (bytes) 1460 1460 1460
Inter Arrival Time
Distribution Constant Constant Constant
Value (micro sec) 1300 1300 1300
Node Properties: In Transport Layer properties, set
TCP Properties
MSS(bytes) 1460 1460 1460
Congestion Control
Algorithm
Old Tahoe Old Tahoe Old Tahoe
Window size(MSS) 8 8 8
Router Properties: Accept default properties for Router.
Link
Properties
Link 1 Link 2 Link 3 Link 4 Link 5 Link 6 Link 7
Max Uplink
Speed
(Mbps)
8 8 8 10 8 8 8
Max
Downlink
Speed(Mbps)
8 8 8 10 8 8 8
Uplink BER 0.000001 0.000001 0.000001 0.000001 0.000001 0.000001 0.000001
Downlink
BER
0.000001 0.000001 0.000001 0.000001 0.000001 0.000001 0.000001
Simulation Time- 10 Sec
Upon completion of simulation, “Save” the experiment.
(Note: The Simulation Time can be selected only after doing the following two tasks,
 Set the properties of Node, Router & Link
 Then click on Run Simulation button).
Sample 3.b: Tahoe (3 clients and 3 servers)
Do the experiment as sample 3.a, and change the TCP congestion algorithm to Tahoe. Upon
completion of simulation, “Save” the experiment.
9.3 Output
Comparison Table:
TCP
Downloads
Metrics
Slow start +
Congestion avoidance
Fast
Retransmit
1 client and 1
server
Throughput(Mbps) 5.926432 6.120320
Segments Retransmitted +
Seg Fast Retransmitted
195 200
2 clients and 2
servers
Throughput(Mbps) 8.796208 8.810224
Segments Retransmitted +
Seg Fast Retransmitted
343 378
3 clients and 3
servers
Throughput(Mbps) 9.144272 9.23304
Segments Retransmitted +
Seg Fast Retransmitted
401 434
Note: To calculate the “Throughput (Mbps)” for more than one application, add the
individual application throughput which is available in Application Metrics (or Metrics.txt) of
Performance Metrics screen. In the same way calculate the metrics for “Segments
Retransmitted + Seg Fast Retransmitted” from TCP Metrics  Connection Metrics.
9.4 Inference:
User lever throughput: User lever throughput of Fast Retransmit is higher when compared
then the Old Tahoe (SS + CA). This is because, if a segment is lost due to error, Old Tahoe
waits until the RTO Timer expires to retransmit the lost segment, whereas Tahoe (FR)
retransmits the lost segment immediately after getting three continuous duplicate ACK‟s.
This results in the increased segment transmissions, and therefore throughput is higher in the
case of Tahoe.
10. Implementation of QoS in IEEE 802.11e
Network
10.1 Theory:
IEEE 802.11e Medium Access Control (MAC) is an emerging supplement to the IEEE
802.11 Wireless Local Area Network (WLAN) standard to support Quality-of-Service (QoS).
The 802.11e MAC is based on both centrally-controlled and contention-based channel
accesses. The standard is considered of critical importance for delay-sensitive applications. It
offers all subscribers high-speed Internet access with video, audio, and voice over IP.
10.2 Procedure:
Step 1:
Go to Simulation  New  Internetworks
Sample 1:
Step 2:
Create scenario as per the screen shot:
Devices Required:
2 Wireless Node, 1 Access point,
1 Router, 1 Wired Node
Step 3:
Access Point Properties AP C
Global Properties
X_Coordinate 250
Y_Coordinate 100
Step 4:
Wireless Node Properties Wireless Node B Wireless Node C
Global Properties
X_Coordinate 300 250
Y_Coordinate 100 150
Step 5:
Node properties: Disable TCP in all nodes in Transport layer as follows:
Wireless Link Properties:
Right click on Wireless link and Change the channel characteristics as “No Path Loss”
Channel Characteristics No Path Loss
Wired Link Properties:
Right click on Wired link and Change the Bit Error Rate
Wired Link Properties
Bit Error Rate 0
Access Point Properties:
Right click on access point properties. In interface1_Wireless, enable IEEE802.11e and set
the buffer size as 5 as shown in below figure:-
Wireless Node Properties:
Right click on Wireless Node and in Interface1_Wireless, enable IEEE802.11e.
Step 6:
Select the Application Button and click on the gap between the Grid Environment and the
ribbon. Now right click on Application and select Properties as shown below:
Application Type Voice (Codec -Custom) CBR
Source ID 1 (Wired Node E) 1(Wired Node E)
Destination ID 4 ( Wireless Node C) 5( Wireless Node B)
Packet Size
Distribution Constant Constant
Value(Bytes) 1000 1000
Inter Arrival Time
Distribution Constant Constant
Value(µs) 800 800
NOTE: The procedure to create multiple applications are as follows:
Step 1: Click on the ADD button present in the bottom left corner to add a new
application.
Simulation Time – 10 sec
After completion of the experiment, “Save” the experiment as Sample 1.
Sample 2:
Open Sample 1, and disable IEEE_802.11e in both Access point and Wireless Node
properties and run the simulation for 10 seconds.
10.3 Output
Comparison Table:
IEEE 802.11e Application Generation rate
(Mbps)
Throughput
(Mbps)
Delay
(Micro. Sec.)
Enable Voice 10 4.67 2782736.5
CBR 10 0.0 0
Disable Voice 10 2.28 4099938.2
CBR 10 2.28 4100423.3
10.4 Inference
802.11e is a proposed enhancement to the 802.11a and 802.11b Wireless LAN (WLAN)
specifications. It offers quality of service including which prioritization of voice, video and
data transmissions. Hence Throughput is obtained for voice transmission.
11. Study the working and routing table
formation of Interior routing protocols, i.e.
Routing Information Protocol (RIP) and Open
Shortest Path First (OSPF)
11.1 Theory:
RIP
RIP is intended to allow hosts and gateways to exchange information for computing routes
through an IP-based network. RIP is a distance vector protocol which is based on Bellman-
Ford algorithm. This algorithm has been used for routing computation in the network.
Distance vector algorithms are based on the exchange of only a small amount of information
using RIP messages.
Each entity (router or host) that participates in the routing protocol is assumed to keep
information about all of the destinations within the system. Generally, information about all
entities connected to one network is summarized by a single entry, which describes the route
to all destinations on that network. This summarization is possible because as far as IP is
concerned, routing within a network is invisible. Each entry in this routing database includes
the next router to which datagrams destined for the entity should be sent. In addition, it
includes a "metric" measuring the total distance to the entity.
Distance is a somewhat generalized concept, which may cover the time delay in getting
messages to the entity, the dollar cost of sending messages to it, etc. Distance vector
algorithms get their name from the fact that it is possible to compute optimal routes when the
only information exchanged is the list of these distances. Furthermore, information is only
exchanged among entities that are adjacent, that is, entities that share a common network.
OSPF
In OSPF, the Packets are transmitted through the shortest path between the source and
destination.
Shortest path:
OSPF allows administrator to assign a cost for passing through a link. The total cost of a
particular route is equal to the sum of the costs of all links that comprise the route. A router
chooses the route with the shortest (smallest) cost.
In OSPF, each router has a link state database which is tabular representation of the topology
of the network (including cost). Using dijkstra algorithm each router finds the shortest path
between source and destination.
Formation of OSPF Routing Table
1. OSPF-speaking routers send Hello packets out all OSPF-enabled interfaces. If two
routers sharing a common data link agree on certain parameters specified in their
respective Hello packets, they will become neighbors.
2. Adjacencies, which can be thought of as virtual point-to-point links, are formed between
some neighbors. OSPF defines several network types and several router types. The
establishment of an adjacency is determined by the types of routers exchanging Hellos
and the type of network over which the Hellos are exchanged.
3. Each router sends link-state advertisements (LSAs) over all adjacencies. The LSAs
describe all of the router's links, or interfaces, the router's neighbors, and the state of the
links. These links might be to stub networks (networks with no other router attached), to
other OSPF routers, or to external networks (networks learned from another routing
process). Because of the varying types of link-state information, OSPF defines multiple
LSA types.
4. Each router receiving an LSA from a neighbor records the LSA in its link-state
database and sends a copy of the LSA to all of its other neighbors.
5. By flooding LSAs throughout an area, all routers will build identical link-state databases.
6. When the databases are complete, each router uses the SPF algorithm to calculate a loop-
free graph describing the shortest (lowest cost) path to every known destination, with
itself as the root. This graph is the SPF tree.
7. Each router builds its route table from its SPF tree
11.2 Procedure
Sample 1:
Step 1:
Go to Simulation  New  Internetworks
Step 2:
Click & drop Routers, Switches and Nodes onto the Simulation Environment and link them
as shown:
Step 3:
These properties can be set only after devices are linked to each other as shown above.
Set the properties of the Router 1 as follows:
Node Properties: In Wired Node H, go to Transport Layer and set TCP as Disable
Switch Properties: Accept default properties for Switch.
Link Properties: Accept default properties for Link.
Application Properties: Click and drop the Application icon and set properties as follows:
Simulation Time - 100 Sec
After Simulation is performed, save the experiment.
(Note: The Simulation Time can be selected only after doing the following two tasks,
 Set the properties of Node, Switch, Router& Application
 Then click on Run Simulation button).
Sample 2:
To model a scenario, follow the same steps as given in Sample1 and set the Router A
properties as given below:
Link Properties:
Link Properties Link 3 Link 4 Link 5 Link 6 Link 7
Uplink Speed 100 100 100 10 10
Downlink Speed 100 100 100 10 10
Node Properties: In Wired Node H, go to Transport Layer and set TCP as Disable
Switch Properties: Accept default properties for Switch.
Application Properties: Click and drop the Application icon and set properties as in Sample
1.
Simulation Time- 100 Sec
(Note: The Simulation Time can be selected only after doing the following two tasks,
 Set the properties of Node, Switch, Router& Application
 Then click on Run Simulation button).
11.3 Output and Inference:
RIP
In Distance vector routing, each router periodically shares its knowledge about the entire
network with its neighbors. The three keys for understanding the algorithm,
1. Knowledge about the whole network
Router sends all of its collected knowledge about the network to its neighbors
2. Routing only to neighbors
Each router periodically sends its knowledge about the network only to those routers to
which it has direct links. It sends whatever knowledge it has about the whole network
through all of its ports. This information is received and kept by each neighboring router and
used to update that router‟s own information about the network
3. Information sharing at regular intervals
For example, every 30 seconds, each router sends its information about the whole
network to its neighbors. This sharing occurs whether or not the network has changed
since the last time information was exchanged
In NetSim the Routing table Formation has 3 stages
Initial Table: This table will show the direct connections made by each Router.
Intermediate Table: The Intermediate table will have the updates of the Network in every
30 seconds
Final Table: This table is formed when there is no update in the Network.
The data should be forwarded using Routing Table with the shortest distance
The RIP table in NetSim
 After running Sample1, click RIP table in Performance Metrics screen. Then click the
respective router to view the Routing table.
 We have shown the routing table for Router 1,
Shortest Path from Wired Node H to WiredNode I in RIP (Use Packet Animation to view) :
WiredNode HSwitch FRouter1Router4Router5Switch GWired Node I
OSPF
The main operation of the OSPF protocol occurs in the following consecutive stages and
leads to the convergence of the internetworks:
1. Compiling the LSDB.
2. Calculating the Shortest Path First (SPF) Tree.
3. Creating the routing table entries.
Compiling the LSDB
The LSDB is a database of all OSPF router LSAs. The LSDB is compiled by an ongoing
exchange of LSAs between neighboring routers so that each router is synchronized with its
neighbor. When the Network converged, all routers have the appropriate entries in their
LSDB.
Calculating the SPF Tree Using Dijkstra's Algorithm
Once the LSDB is compiled, each OSPF router performs a least cost path calculation called
the Dijkstra algorithm on the information in the LSDB and creates a tree of shortest paths to
each other router and network with themselves as the root. This tree is known as the SPF
Tree and contains a single, least cost path to each router and in the Network. The least cost
path calculation is performed by each router with itself as the root of the tree
Calculating the Routing Table Entries from the SPF Tree
The OSPF routing table entries are created from the SPF tree and a single entry for each
network in the AS is produced. The metric for the routing table entry is the OSPF-calculated
cost, not a hop count.
The OSPF table in NetSim
 After running Sample 2, click OSPF Metrics in Performance Metrics screen. Then click
the router to view the Routing table
 We have shown the routing table for Router 1:
Shortest Path from Wired Node H to WiredNode I in OSPF (Use Packet Animation to view):
WiredNode HSwitch FRouter1Router2Router3Router5Switch G
WiredNode I
Note: The Cost is calculated by using the following formula
Reference Bandwidth = 100 Mbps
For Example,
Let us take, Link Speed UP = 100 Mbps
12. Experiment on M/D/1 Queue:
-To create an M/D/1 queue: a source to generate packets,
a queue to act as the buffer and server, a sink to dispose
of serviced packets.
-To study how the queuing delay of such a system varies.
12.1 Theory:
In systems where the service time is a constant, the M/D/1, single-server queue model, can be
used. Following Kendall's notation, M/D/1 indicates a system where:
 Arrivals are a Poisson process with parameter λ
 Service time(s) is deterministic or constant
 There is one server
For an M/D/1 model, the total expected queuing time is
Where µ = Service Rate = 1/Service time and  is the utilization given as follows,
To model an M/D/1 system in NetSim, we use the following model
Traffic flow from Node 1 to Node 2 (Node 1: Source, Node 2: Sink)
Inter-arrival time: Exponential Distribution with mean 2000 µs
Packet size: Constant Distribution with mean of 1250 bytes
Note:
1. Exponentially distributed inter-arrivals times give us a Poisson arrival process.
Different mean values are chosen as explained in the section Sample Inputs.
(Dropping the devices in different order may change the result because the random
number generator will get initialized differently)
2. To get constant service times, we use constant distribution for packet sizes. Since, the
service (which in our case is link transmission) times are directly proportional to
packet size (greater the packet size, greater the time for transmission through a link), a
constant packet size leads to a constant service time.
Procedure:
Create Scenario: “Simulation  New  Internetworks”.
Nodes 1 and Node 2 are connected with Router 1 by Link 1 and Link 2 respectively. Set the
properties for each device as given below,
Sample 1:
Application Properties: Click and drop the Application icon and set following properties:
Application Type Custom
Source_Id 1
Destination_Id 2
Packet Size Distribution Constant
Value (bytes) 1250
Inter Arrival Time Distribution Exponential
Packet Inter Arrival
Time (µs)
2000
Disable TCP in the Transport Layer in Node Properties as follows:
Link Properties Link 1 Link 2
Uplink Speed (Mbps) 10 10
Downlink Speed (Mbps) 10 10
Uplink BER 0 0
Downlink BER 0 0
Uplink Propagation Delay (ms) 0 0
Downlink Propagation Delay
(ms)
0 0
Router Properties: Accept the default properties for Router.
Simulation Time: 100 Sec
Observation:
Even though the packet size at the application layer is 1250 bytes, as the packet moves down
the layers, some overhead is added which results in a greater packet size. This is the actual
payload that is transmitted by the physical layer. The overheads added in different layers are
shown in the table:
Therefore, the payload size = Packet Size + Overhead
= 1250 + 54
= 1304 bytes
Theoretical Calculation:
By formula,
µ = Service Rate, i.e., the time taken to service each packet
Layer Overhead
(Bytes)
Transport Layer 8
Network Layer 20
MAC layer 26
Physical Layer 0
Total 54
= Link capacity (bps) / (Payload Size (Bytes) * 8)
= (10×106
) / (1304*8)
= 958.59 packets / sec
λ = Arrival rate, i.e., the rate at which packets arrive (Packets per second)
Inter-arrival time = 2,000 micro sec
Arrival rate λ = 1/ Inter Arrival time
= 1/2000 micro sec
= 500 packets / sec
ρ = Utilization
= λ/µ
= 500/958.59
= 0.522
By formula, Queuing Time = = 569.61 micro sec
12.2 Output:
After running the simulation, check the “Delay” in the Application Metrics.
Delay = 2656.855 micro sec
This Delay (also known as Mean Delay) is the sum of Queuing Delay, Total Transmission
time and Routing Delay.
( ) ( ) ( ) ( )
Total Transmission Time is the sum of transmission time through Link 1 and Link 2.
Transmission time through each link is the same and is given by:
Transmission time through each link =
=
= 1043.2 micro sec
Routing Delay is approximately 1 micro sec and can be found from the Event Trace. It is the
difference between “Physical In” and “Physical Out” time for the Router.
Therefore, for simulation
Queuing Delay = 2656.855– (2 × 1043.2) – 1 = 569.455 micro sec
Sample 2
Keeping all the other parameters same as in previous example, if Packet Inter Arrival Time is
taken as 1500 micro sec, then
λ = 666.67 packets per sec
Utilization ρ = λ/µ = 666.67/958.59 = 0.695
And Queuing Time T = 1188.56 micro sec
From NetSim,
Delay = 3279.297 micro sec
Therefore, Queuing Time = 3279.298 - (2×1043.2) – 1
= 1191.898 micro sec
Note: Obtained value is slightly higher than the theoretical value because of initial delays in
forming ARP table, Switch table and Routing table etc.
A Note on M/M/1 queuing in NetSim
M/M/1 queue can be generated similarly by setting the “Packet Size Distribution” as
“Exponential” instead of “Constant”. However, the results obtained from simulation deviate
from the theoretical value because of the effect of packet fragmentation. Whenever a packet
with size greater than Transport Layer MSS and / or MAC Layer MTU (which is 1500 bytes
in NetSim) is generated, it gets fragmented in the application layer. Then the packet is sent as
multiple frames, and makes it impossible to calculate the exact queuing time.
13. Datagram network
Study theory from NetSim “Basic Menu Introductiondatagram”
14. Distance Vector Routing
Objective: Write a C/C++ program to verify the distance vector routing algorithm
14.1 Theory:
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 forms the
routing table and delivers the packets depending upon the routes in the table – either 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 Routing.
14.2 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 greater than
the its neighbor‟s entry.
 Write the next stage of routing table into the file.
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.
14.3 Procedure:
To begin with the experiment, open NetSim
Click on Programming from the menu bar and select Distance Vector Routing
Step 1:
The scenario will be obtained as shown below. Follow the steps.
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.
Select the Mode
Click Run to execute the Program
Connect the Routers
.
14.4 Results (to be filled up by the students):
Step 2:
For user to write their own C Code in NetSim and check the result, click on Interface
Source Code (present in Help in the left pane).
Open Dev C++ or any GNU C compiler based IDK and copy the code from the Interface
Source Code.
The user needs to edit the Interface Source Code at the following location.
void fnDistVectAlgorithm()
{
// Write your own code here
}
So the user needs to add the user code, create exe and attach it with NetSim to run.
The User code which is to be added is given below
void fnDistVectAlgorithm()
{
/////* User code part start */
Output Table
do// This do while... loop is to update the table information till it
knows all the router's information present in the network.
{
// I for//To go to No of router
for(nRouterTable=1;nRouterTable<=g_nNoOfRouters;nRouterTable++)
{// II for //Select the source router
for(nNeighbour=1;nNeighbour<=g_nNoOfRouters;nNeighbour++)
{// III for//move to all router
if(Table[nRouterTable].nCostID[nNeighbour]==1)
{// I if //select the neigh router
int nDestID=1;
for(nDestID=1;nDestID<=g_nNoOfRouters;nDestID++)
{// IV for //select the routing table of
neigh
if(nDestID!=nRouterTable)
{// II if
if((Table[nRouterTable].nDestID[nDestID] == 0) &&
(Table[nNeighbour].nDestID[nDestID]!=0))// ||
{// III if //This loop is to
check whether the neighbour router is DESTINATION or not.
Table[nRouterTable].nDestID[nDestID] = nDestID;
Table[nRouterTable].nNextHop[nDestID] = nNeighbour;
Table[nRouterTable].nCostID[nDestID]=(Table[nNeighbour].nCostID[nDestID]+1);
}
else
if((Table[nRouterTable].nNextHop[nDestID]!=nDestID||Table[nRouterTable].nCostID[nDe
stID]!=1)&&(Table[nNeighbour].nDestID[nDestID]!=0))
{// else if
// This loop is to check
whether the neighbour router is the destination or not and also check whether the
cost ID is 1 or not.
if(Table[nRouterTable].nCostID[nDestID]>Table[nNeighbour].nCostID[nDestID])
{//IV if
//This loop is to find
the least cost path
Table[nRouterTable].nDestID[nDestID] = nDestID;
Table[nRouterTable].nNextHop[nDestID] = nNeighbour;
Table[nRouterTable].nCostID[nDestID]=(Table[nNeighbour].nCostID[nDestID]+1);
}//end IV if
}//end else if
}// end II if
}//end IV for
}// end I if
}//end III for
}// end II for
nStage++;
fnDisplay(nStage);
}while(nStage<2);
/////* User code part end */
}
Create .exe file (Appendix 2: Creating .exe file using Dev C++)
In the left panel, select the Mode as User. Select the .exe file created above.
Click on 1 router and another router consecutively to connect them. Click Run.
So presently NetSim will run Distance Vector Routing code which is written by the user and
will display the result graphically.
In case of any error, “ERROR IN USER CODE” message will be displayed.
Note- How to practice this experiment without using NetSim
Users who do not have a licensed version of NetSim in their PC's, can practice as explained
below.
First, run the exercise in sample mode. The user would see that an Input.txt file is created in
Win OS temp folder (this can be reached by typing %temp%/NetSim in Windows run
window). This input file should be read by the user code and it should generate an Output.txt.
This Output.txt file is read by NetSim and shown graphically to the user.
User can follow the steps provided in Appendix 1: Programming exercise - How to practice
without NetSim.
Given below are sample Input.txt and Output.txt files for this experiment for users to verify
& validate their code
Input.txt file contents
Router_ID=1>Router_Name=Router_1>No_Of_Neighbour=1>Neighbours_ID=2
Router_ID=2>Router_Name=Router_2>No_Of_Neighbour=4>Neighbours_ID=1>3>6>5
Router_ID=3>Router_Name=Router_3>No_Of_Neighbour=2>Neighbours_ID=2>4
Router_ID=4>Router_Name=Router_4>No_Of_Neighbour=2>Neighbours_ID=3>6
Router_ID=5>Router_Name=Router_5>No_Of_Neighbour=1>Neighbours_ID=2
Router_ID=6>Router_Name=Router_6>No_Of_Neighbour=2>Neighbours_ID=4>2
Output.txt file contents
0>1>2>1>0
0>2>1>1>0
0>2>3>1>0
0>2>5>1>0
0>2>6>1>0
0>3>2>1>0
0>3>4>1>0
0>4>3>1>0
0>4>6>1>0
0>5>2>1>0
0>6>2>1>0
0>6>4>1>0
1>1>2>1>0
1>1>3>2>2
1>1>5>2>2
1>1>6>2>2
1>2>1>1>0
1>2>3>1>0
1>2>4>2>6
1>2>5>1>0
1>2>6>1>0
1>3>1>2>2
1>3>2>1>0
1>3>4>1>0
1>3>5>2>2
1>3>6>2>4
1>4>1>3>3
1>4>2>2>6
1>4>3>1>0
1>4>5>3>3
1>4>6>1>0
1>5>1>2>2
1>5>2>1>0
1>5>3>2>2
1>5>4>3>2
1>5>6>2>2
1>6>1>2>2
1>6>2>1>0
1>6>3>2>4
1>6>4>1>0
1>6>5>2>2
2>1>2>1>0
2>1>3>2>2
2>1>4>3>2
2>1>5>2>2
2>1>6>2>2
2>2>1>1>0
2>2>3>1>0
2>2>4>2>6
2>2>5>1>0
2>2>6>1>0
2>3>1>2>2
2>3>2>1>0
2>3>4>1>0
2>3>5>2>2
2>3>6>2>4
2>4>1>3>6
2>4>2>2>6
2>4>3>1>0
2>4>5>3>6
2>4>6>1>0
2>5>1>2>2
2>5>2>1>0
2>5>3>2>2
2>5>4>3>2
2>5>6>2>2
2>6>1>2>2
2>6>2>1>0
2>6>3>2>4
2>6>4>1>0
2>6>5>2>2
15. IPV6 Addressing - EUI-64 Interface
Identifier
Programming Guidelines
This section guides the user to link his/her own code for EUI 64 Interface Identifier to
NetSim.
Pre - Conditions
The user program should read the inputted scenario from text file named „Input‟ with
extension txt.
The user program after executing the concept should write the required output to a file named
„Output’ with extension txt.
Note:The temporary directory is navigated through the following step.
Run Type "%temp%"  NetSim  "Input.txt" and "Output.txt"
(Note : To open Run Press Windows+R)
General Program Flow
The program begins with the Reading of the Inputs from the input file Input.txt.
Executing the required concept and,
The results of the program should be written into the output file Output.txt.
File Format
Input File Output File
IPV6_Network_Id=2000:FE21:5931:72
C3
MAC_Address=11-11-FF-FF-12-34
The Output File format
MAC Address>
First part of MAC Address>Second part of MAC
Address
FF-EE appended Address>
First byte value>Binary value of First byte>
7th bit value>Complement value of 7th bit
Complemented binary value of First byte>Hexa
decimal value of complemented binary value>
Interface Id value> Interface Id in colon notation>
IPV6 prefix value>
IPV6 Address>
Sample Output text Format
11-11-FF-FF-12-34>
11-11-FF>FF-12-34>
11-11-FF-FF-FE-FF-12-34>
11>00010001>
0>1>
00010011>13>
13-11-FF-FF-FE-FF-12-
34>1311:FFFF:FEFF:1234>
2000:FE21:5931:72C3>
2000:FE21:5931:72C3:1311:FFFF:FEFF:1234>
Interface Source Code
Interface source code written in C is given using this the user can write only the fnEUI64 ()
function using the variables already declared. To view the interface source code, go to
NetSim Installation path / src / Programming/ IPV6EUI64.c
To find NetSim‟s Installation path right click NetSim icon and select
 Open file location in Windows 7
 Open file location in Windows Vista
 Properties  find target in Windows XP.
Sample Scenarios:
Objective - To understand the concept of EUI 64 Interface Identifier through programming.
How to Proceed? - The objective can be executed in NetSim using the programming
exercise available, under programming user has to select IPV6 Addressing  EUI 64
Interface Identifier,
Sample Inputs - In the Input panel the following steps need to be done,
 SampleMode should be selected.
 Select the IPV6 Network Id (IPV6 Prefix)
 Enter the MAC Address.
 Then Run button need to be clicked. Refresh button can be used if new
Inputs have to be given.
Output - The following steps are under gone internally,
 MAC Address is divided into two parts
 FF-FE value is appended between the two parts
 Interface Identifier is found by complementing 7th
bit of firs byte
 IPV6 Network Id (IPV6 prefix) and Interface Identifier are combined to
produce IPV6 address
 Once the sample experiment is done, then Refresh button can be clicked to
create New Samples.
16. IPV6 Host Addresses
Programming Guidelines
This section guides the user to link his/her own code for IPV6 Host Addresses to NetSim.
Pre - Conditions
The user program should read the inputted scenario from text file named „Input‟ with
extension txt.
The user program after executing the concept should write the required output to a file named
„Output’ with extension txt.
Note:The temporary directory is navigated through the following step.
Run Type "%temp%"  NetSim  "Input.txt" and "Output.txt"
(Note : To open Run Press Windows+R)
General Program Flow
The program begins with the Reading of the Inputs from the input file Input.txt.
Executing the required concept and,
The results of the program should be written into the output file Output.txt.
File Format
Input File Format Output File Format
IPV6_Address=1111:2222:
3333:4444:AAAA:BBBB:
CCCC:DDDD
Prefix_Length=12
The Output File format
IPV6 Address>
Binary value of IPV6 Address>
Prefix part of IPV6 Address>Suffix part of IPV6 Address>
Prefix part of Starting Address>Suffix part of Starting
Address>
Starting Address in hexa decimal notation>
Prefix part of Ending Address>Suffix part of Ending
Address>
Ending Address in hexa decimal notation>
Sample Output text Format
1111:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>
000100010001000100100010001000100011001100110011
010001000100010010101010101010101011101110111011
11001100110011001101110111011101>12>116>
000100010001>00010010001000100010001100110011001
101000100010001001010101010101010101110111011101
111001100110011001101110111011101>
000100010001>00000000000000000000000000000000000
000000000000000000000000000000000000000000000000
000000000000000000000000000000000>
1110:0000:0000:0000:0000:0000:0000:0000>
000100010001>11111111111111111111111111111111111
111111111111111111111111111111111111111111111111
111111111111111111111111111111111>
111F:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF>
Interface Source Code
Interface source code written in C is given using this the user can write only the
fnHostAddresses () function using the variables already declared. To view the interface
source code, go to
NetSim Installation path / src / Programming/ IPV6HostAddress.c
To find NetSim‟s Installation path right click NetSim icon and select
 Open file location in Windows 7
 Open file location in Windows Vista
 Properties  find target in Windows XP.
Sample Scenarios:
Objective - To understand the concept of IPV6 Host Addresses through programming.
How to Proceed? - The objective can be executed in NetSim using the programming
exercise available, under programming user has to select IPV6 Addressing IPV6 Host
Addresses,
Sample Inputs - In the Input panel the following steps need to be done,
 SampleMode should be selected.
 Enter the IPV6 Address.
 Select the Prefix length.
 Then Run button need to be clicked. Refresh button can be used if new
Inputs have to be given.
Output - The following steps are under gone internally,
 IPV6 is separated into two parts: Network Id bits (prefix) and Host Id bits
(suffix)
 Starting address of the network is found by replacing each bits of suffix part
with zero
 Ending address of the network is found by replacing each bits of suffix part
with one
 Once the sample experiment is done, then Refresh button can be clicked to
create New Samples.
17. IPV6 Subnetting
Programming Guidelines
This section guides the user to link his/her own code for IPV6 Subnetting to NetSim.
Pre - Conditions
The user program should read the inputted scenario from text file named „Input‟ with
extension txt.
The user program after executing the concept should write the required output to a file named
„Output’ with extension txt.
Note:The temporary directory is navigated through the following step.
Run Type "%temp%"  NetSim  "Input.txt" and "Output.txt"
(Note : To open Run Press Windows+R)
General Program Flow
The program begins with the Reading of the Inputs from the input file Input.txt.
Executing the required concept and,
The results of the program should be written into the output file Output.txt.
File Format
Input File Format Output File Format
IPV6_Address=1111:2222:3
333:4444:AAAA:BBBB:CC
CC:DDDD
Prefix_Length=12
Number_of_Subnets=2
Number_of_Level=2
Subnets_in_Level1=2
Subnets_in_Level2=4
The Output File format
Binary value of IPV6 Address>
Prefix part of IPV6 Address>Suffix part of IPV6 Address>
Number of subnets>number of subnet msk bit>
Prefix part of IPV6 Address>Subnet Id part of IPV6
address>Suffix part of IPV6 Address>
Prefix part of IPV6 Address>Subnet Id part of IPV6
address>Suffix part of IPV6 Address>
Prefix part of Level 1 „s first subnet Address> Subnet Id part
of Level 1 „s first subnet Address> Suffix part of Level 1 „s
first subnet Address> Hexa decimal value of Level 1 „s first
subnet address>prefix length of Level 1 „s first subnet>
.
.
until number of subnet reached in the first level
First level‟s subnet number>Prefix part of Level 2 „s first
subnet Address> Subnet Id part of Level 2 „s first subnet
Address> Suffix part of Level 2 „s first subnet Address>
Hexa decimal value of Level 2 „s first subnet address>prefix
length of Level 2 „s first subnet>
.
.
until the number of subnets reached in the second level of
first level‟s subnet
.
.
until the number of subnets reached in the first level
Sample Output text Format
1111:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>
0001000100011001001000100010001000110011001100110
1000100010001001010101010101010101110111011101111
001100110011001101110111011101>
000100010001>000100100010001000100011001100110011
0100010001000100101010101010101010111011101110111
1001100110011001101110111011101>2>1>
000100010001>0>001001000100010001000110011001100
1101000100010001001010101010101010101110111011101
111001100110011001101110111011101>
000100010001>0>001001000100010001000110011001100
1101000100010001001010101010101010101110111011101
111001100110011001101110111011101>1111:2222:3333:4
444:AAAA:BBBB:CCCC:DDDD>13>
000100010001>1>001001000100010001000110011001100
1101000100010001001010101010101010101110111011101
111001100110011001101110111011101>1119:2222:3333:4
444:AAAA:BBBB:CCCC:DDDD>13>
0>1111:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>15>
0>1113:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>15>
0>1115:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>15>
0>1117:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>15>
1>1119:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>15>
1>111B:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>15>
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual
Maharastra CCN  NetSim Experiment  Manual

More Related Content

What's hot

Tech note umts
Tech note umtsTech note umts
Tech note umtsMorg
 
T Series Core Router Architecture Review (Whitepaper)
T Series Core Router Architecture Review (Whitepaper)T Series Core Router Architecture Review (Whitepaper)
T Series Core Router Architecture Review (Whitepaper)Juniper Networks
 
95763406 atoll-3-1-0-user-manual-lte
95763406 atoll-3-1-0-user-manual-lte95763406 atoll-3-1-0-user-manual-lte
95763406 atoll-3-1-0-user-manual-ltearif budiman
 
Teamviewer manual
Teamviewer manualTeamviewer manual
Teamviewer manualjeetjsr11
 
A Matlab Implementation Of Nn
A Matlab Implementation Of NnA Matlab Implementation Of Nn
A Matlab Implementation Of NnESCOM
 
An Introduction to Computational Networks and the Computational Network Toolk...
An Introduction to Computational Networks and the Computational Network Toolk...An Introduction to Computational Networks and the Computational Network Toolk...
An Introduction to Computational Networks and the Computational Network Toolk...Willy Marroquin (WillyDevNET)
 
Metasploit
MetasploitMetasploit
Metasploitnoc_313
 
Fuzzy and Neural Approaches in Engineering MATLAB
Fuzzy and Neural Approaches in Engineering MATLABFuzzy and Neural Approaches in Engineering MATLAB
Fuzzy and Neural Approaches in Engineering MATLABESCOM
 
Team Omni L2 Requirements Revised
Team Omni L2 Requirements RevisedTeam Omni L2 Requirements Revised
Team Omni L2 Requirements RevisedAndrew Daws
 
Wireless m-bus-quick-start-guide
Wireless m-bus-quick-start-guideWireless m-bus-quick-start-guide
Wireless m-bus-quick-start-guide봉조 김
 
Lartc
LartcLartc
Lartcgobed
 
Master Thesis - A Distributed Algorithm for Stateless Load Balancing
Master Thesis - A Distributed Algorithm for Stateless Load BalancingMaster Thesis - A Distributed Algorithm for Stateless Load Balancing
Master Thesis - A Distributed Algorithm for Stateless Load BalancingAndrea Tino
 

What's hot (19)

Tech note umts
Tech note umtsTech note umts
Tech note umts
 
T Series Core Router Architecture Review (Whitepaper)
T Series Core Router Architecture Review (Whitepaper)T Series Core Router Architecture Review (Whitepaper)
T Series Core Router Architecture Review (Whitepaper)
 
95763406 atoll-3-1-0-user-manual-lte
95763406 atoll-3-1-0-user-manual-lte95763406 atoll-3-1-0-user-manual-lte
95763406 atoll-3-1-0-user-manual-lte
 
Teamviewer manual
Teamviewer manualTeamviewer manual
Teamviewer manual
 
Administrator manual-e2
Administrator manual-e2Administrator manual-e2
Administrator manual-e2
 
A Matlab Implementation Of Nn
A Matlab Implementation Of NnA Matlab Implementation Of Nn
A Matlab Implementation Of Nn
 
SEAMLESS MPLS
SEAMLESS MPLSSEAMLESS MPLS
SEAMLESS MPLS
 
An Introduction to Computational Networks and the Computational Network Toolk...
An Introduction to Computational Networks and the Computational Network Toolk...An Introduction to Computational Networks and the Computational Network Toolk...
An Introduction to Computational Networks and the Computational Network Toolk...
 
final (1)
final (1)final (1)
final (1)
 
Metasploit
MetasploitMetasploit
Metasploit
 
XORP manual
XORP manualXORP manual
XORP manual
 
iPDC User Manual
iPDC User ManualiPDC User Manual
iPDC User Manual
 
Fuzzy and Neural Approaches in Engineering MATLAB
Fuzzy and Neural Approaches in Engineering MATLABFuzzy and Neural Approaches in Engineering MATLAB
Fuzzy and Neural Approaches in Engineering MATLAB
 
project book
project bookproject book
project book
 
Team Omni L2 Requirements Revised
Team Omni L2 Requirements RevisedTeam Omni L2 Requirements Revised
Team Omni L2 Requirements Revised
 
Wireless m-bus-quick-start-guide
Wireless m-bus-quick-start-guideWireless m-bus-quick-start-guide
Wireless m-bus-quick-start-guide
 
Lartc
LartcLartc
Lartc
 
Master Thesis - A Distributed Algorithm for Stateless Load Balancing
Master Thesis - A Distributed Algorithm for Stateless Load BalancingMaster Thesis - A Distributed Algorithm for Stateless Load Balancing
Master Thesis - A Distributed Algorithm for Stateless Load Balancing
 
2000330 en
2000330 en2000330 en
2000330 en
 

Similar to Maharastra CCN NetSim Experiment Manual

Extending TFWC towards Higher Throughput
Extending TFWC towards Higher ThroughputExtending TFWC towards Higher Throughput
Extending TFWC towards Higher Throughputstucon
 
Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network
Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network
Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network partha pratim deb
 
NetSIm Technology Library- Cognitive radio
NetSIm Technology Library- Cognitive radioNetSIm Technology Library- Cognitive radio
NetSIm Technology Library- Cognitive radioVishal Sharma
 
comparison_of_scada_protocols_and_implementation_of_iec_104_and_mqtt.pdf
comparison_of_scada_protocols_and_implementation_of_iec_104_and_mqtt.pdfcomparison_of_scada_protocols_and_implementation_of_iec_104_and_mqtt.pdf
comparison_of_scada_protocols_and_implementation_of_iec_104_and_mqtt.pdfteja61850
 
High_Speed_TCP_for_Large_Congestion_Windows.pdf
High_Speed_TCP_for_Large_Congestion_Windows.pdfHigh_Speed_TCP_for_Large_Congestion_Windows.pdf
High_Speed_TCP_for_Large_Congestion_Windows.pdfSHIKHAARYA26
 
High_Speed_TCP_for_Large_Congestion_Windows.pdf
High_Speed_TCP_for_Large_Congestion_Windows.pdfHigh_Speed_TCP_for_Large_Congestion_Windows.pdf
High_Speed_TCP_for_Large_Congestion_Windows.pdfSHIKHAARYA26
 
Unit 3 Assignment 1 Osi Model
Unit 3 Assignment 1 Osi ModelUnit 3 Assignment 1 Osi Model
Unit 3 Assignment 1 Osi ModelJacqueline Thomas
 
Networking principles protocols and practice
Networking principles protocols and practiceNetworking principles protocols and practice
Networking principles protocols and practiceDAVID RAUDALES
 
Improved SCTP Scheme To Overcome Congestion Losses Over Manet
Improved SCTP Scheme To Overcome Congestion Losses Over ManetImproved SCTP Scheme To Overcome Congestion Losses Over Manet
Improved SCTP Scheme To Overcome Congestion Losses Over ManetIJERA Editor
 
LTE_from_Theory_to_Practise.pdf
LTE_from_Theory_to_Practise.pdfLTE_from_Theory_to_Practise.pdf
LTE_from_Theory_to_Practise.pdfATEC3
 
Enterprise Data Center Networking (with citations)
Enterprise Data Center Networking (with citations)Enterprise Data Center Networking (with citations)
Enterprise Data Center Networking (with citations)Jonathan Williams
 

Similar to Maharastra CCN NetSim Experiment Manual (20)

thesis
thesisthesis
thesis
 
Netsim experiment manual
Netsim experiment manualNetsim experiment manual
Netsim experiment manual
 
Extending TFWC towards Higher Throughput
Extending TFWC towards Higher ThroughputExtending TFWC towards Higher Throughput
Extending TFWC towards Higher Throughput
 
Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network
Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network
Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network
 
NetSIm Technology Library- Cognitive radio
NetSIm Technology Library- Cognitive radioNetSIm Technology Library- Cognitive radio
NetSIm Technology Library- Cognitive radio
 
comparison_of_scada_protocols_and_implementation_of_iec_104_and_mqtt.pdf
comparison_of_scada_protocols_and_implementation_of_iec_104_and_mqtt.pdfcomparison_of_scada_protocols_and_implementation_of_iec_104_and_mqtt.pdf
comparison_of_scada_protocols_and_implementation_of_iec_104_and_mqtt.pdf
 
High_Speed_TCP_for_Large_Congestion_Windows.pdf
High_Speed_TCP_for_Large_Congestion_Windows.pdfHigh_Speed_TCP_for_Large_Congestion_Windows.pdf
High_Speed_TCP_for_Large_Congestion_Windows.pdf
 
High_Speed_TCP_for_Large_Congestion_Windows.pdf
High_Speed_TCP_for_Large_Congestion_Windows.pdfHigh_Speed_TCP_for_Large_Congestion_Windows.pdf
High_Speed_TCP_for_Large_Congestion_Windows.pdf
 
Report
ReportReport
Report
 
Unit 3 Assignment 1 Osi Model
Unit 3 Assignment 1 Osi ModelUnit 3 Assignment 1 Osi Model
Unit 3 Assignment 1 Osi Model
 
Networking principles protocols and practice
Networking principles protocols and practiceNetworking principles protocols and practice
Networking principles protocols and practice
 
Fulltext02
Fulltext02Fulltext02
Fulltext02
 
etd7288_MHamidirad
etd7288_MHamidiradetd7288_MHamidirad
etd7288_MHamidirad
 
Improved SCTP Scheme To Overcome Congestion Losses Over Manet
Improved SCTP Scheme To Overcome Congestion Losses Over ManetImproved SCTP Scheme To Overcome Congestion Losses Over Manet
Improved SCTP Scheme To Overcome Congestion Losses Over Manet
 
Kumar cscl final
Kumar cscl finalKumar cscl final
Kumar cscl final
 
LTE_from_Theory_to_Practise.pdf
LTE_from_Theory_to_Practise.pdfLTE_from_Theory_to_Practise.pdf
LTE_from_Theory_to_Practise.pdf
 
KHAN_FAHAD_FL14
KHAN_FAHAD_FL14KHAN_FAHAD_FL14
KHAN_FAHAD_FL14
 
M.Sc_Dissertation_Bongomin
M.Sc_Dissertation_BongominM.Sc_Dissertation_Bongomin
M.Sc_Dissertation_Bongomin
 
Enterprise Data Center Networking (with citations)
Enterprise Data Center Networking (with citations)Enterprise Data Center Networking (with citations)
Enterprise Data Center Networking (with citations)
 
synchonization PTP
synchonization PTP synchonization PTP
synchonization PTP
 

Recently uploaded

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 

Recently uploaded (20)

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 

Maharastra CCN NetSim Experiment Manual

  • 2. The information contained in this document represents the current view of TETCOS on the issues discussed as of the date of publication. Because TETCOS must respond to changing market conditions, it should not be interpreted to be a commitment on the part of TETCOS, and TETCOS cannot guarantee the accuracy of any information presented after the date of publication. This manual is for informational purposes only. TETCOS MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. Warning! DO NOT COPY Copyright in the whole and every part of this manual belongs to TETCOS and may not be used, sold, transferred, copied or reproduced in whole or in part in any manner or in any media to any person, without the prior written consent of TETCOS. If you use this manual you do so at your own risk and on the understanding that TETCOS shall not be liable for any loss or damage of any kind. TETCOS may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from TETCOS, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred. Rev 9.0 (MAH CCN), October 2016 , TETCOS. All rights reserved. All trademarks are property of their respective owner. Contact us at – TETCOS 214, 39th A Cross, 7th Main, 5th Block Jayanagar, Bangalore - 560 041, Karnataka, INDIA. Phone: +91 80 26630624 E-Mail: sales@tetcos.com Visit: www.tetcos.com
  • 3. Contents 1. Networking Architecture.......................................................................6 2. Configure and analyze the TCP versus UDP response Time With HTTP Application.....................................................................................................6 3. Simulation of different types of internet traffic such as FTP, TELNET over a network and analyzing the throughput..............................................10 4. Network Socket Programming.............................................................15 5. Simulating a three node point-to-point network and applying relevant applications over TCP and UDP.....................................................................23 6. Stop & Wait Protocol...........................................................................28 7. Go Back N Protocol..............................................................................33 8. Selective Repeat Protocol....................................................................40 9. Study the throughputs of Slow start + Congestion avoidance (Old Tahoe) and Fast Retransmit (Tahoe) Congestion Control Algorithms............47 10. Implementation of QoS in IEEE 802.11e Network ................................56 11. Study the working and routing table formation of Interior routing protocols, i.e. Routing Information Protocol (RIP) and Open Shortest Path First (OSPF) ..................................................................................................61 12. Experiment on M/D/1 Queue:.............................................................69 13. Datagram network ..............................................................................74 14. Distance Vector Routing......................................................................74 15. IPV6 Addressing - EUI-64 Interface Identifier.......................................81
  • 4. 16. IPV6 Host Addresses............................................................................84 17. IPV6 Subnetting...................................................................................87 18. Link State Routing ...............................................................................91 19. Study the working of BGP and formation of BGP Routing table...........98 20. Analyze the performance of a MANET, (running CSMA/CA (802.11b) in MAC) with increasing node mobility...........................................................103 21. Spanning Tree ...................................................................................108 22. Analyzing the difference between Hub Vs Switch transmission .........115 23. Study the effect of Peak Cell Rate (per Sec) and Cell Delay Variation Tolerance on the performance of an ATM Networks....................................56 24. Network performance analysis with an ATM switch implementing different scheduling techniques like First in First out (FIFO), Priority, and Round Robin ................................................................................................60 25. Understand IP forwarding within a LAN and across a router................74 26. Study how the Data Rate of a Wireless LAN (IEEE 802.11b) network varies as the distance between the Access Point and the wireless nodes is varied...........................................................................................................81 27. Analyze the performance of a MANET, (running CSMA/CA (802.11b) in MAC) with increasing node density ..............................................................86 28. Understand the impact of bit error rate on packet error and investigate the impact of error of a simple hub based CSMA / CD network....................95 29. To determine the optimum persistence of a p-persistent CSMA / CD network for a heavily loaded bus capacity. ................................................100 30. To study the working of Time Division Multiple Access technique.....104
  • 5. 31. Orthogonal Frequency Division Multiple Access................................107 32. Plot the characteristic curve throughput versus offered traffic for a Slotted ALOHA system. ..............................................................................112 33. Physical layer services and system ....................................................117 34. Study how call blocking probability varies as the load on a GSM network is continuously increased. ............................................................117 35. Analysis of GSM Handover ................................................................121 36. Study how the number of channels increases and the Call blocking probability decreases as the Voice activity factor of a CDMA network is decreased ..................................................................................................124 37. Mobility Models in Wi-MAX (IEEE 802.16e/m) Network....................128
  • 6. 1.Networking Architecture 1.1 OSI model, TCP-IP Model Refer: Study theory from NetSim “Basic Menu Introduction Networking Architecture” 2.Configure and analyze the TCP versus UDP response Time With HTTP Application 2.1 Theory TCP provides connection-oriented service at the transport layer, and UDP provides connectionless service. As a result, a data exchange using TCP can take longer than the same exchange using UDP. TCP implementations require that the TCP source and destination perform a three-way handshake in order to set up the connection prior to sending data, and a four-way handshake when tearing down the connection. In addition, all data must be acknowledged by the destination when it is received. UDP sources, on the other hand, do not set up connections and so save the overhead in terms of delay and bandwidth usage. UDP is often used when small amounts of data must be sent, for example, when doing credit card verification. If large amounts of data are sent, however, the extra TCP overhead may be negligible in comparison to the entire transaction completion time Part-A – TCP 2.2 Procedure: Sample 1 Step 1: Go to Simulation  New  Internetworks
  • 7. Step 2: Click & drop 2 Wired Nodes and 1 Router on the Simulation Environment as shown and link them. Application Properties Application Type HTTP Source_Id 2(Wired Node D) Destination_Id 3(Wired Node C) Page Property Distribution Constant Page Count 10 Page Size (bytes) 1000 Inter Arrival Time Distribution Constant Value ( secs) 1 Step 3: Enable Packet Trace in Ribbon Step 4: Simulation Time - 10 sec (Note: The Simulation Time can be selected only after the following two tasks,  Enable Packet Trace  Click on Run Simulation button. After completion of the experiment, “Save” the experiment for future analysis of results.
  • 8. Part-B – UDP 2.3 Procedure: Sample 2: Open Sample 1 and Disable TCP in Transport Layer in both Wired Nodes and Router. Simulation Time - 10 sec (Note: The Simulation Time can be selected only after the following two tasks,  Enable Packet Trace  Click on Run Simulation button) 2.3.1 Output: Open Packet Trace from performance metrics window Apply filter option from Excel sheet, filter PACKET TYPE column: Select only HTTP TCP Packet Trace TCP Response Time: 1000385.28 - 1000054.56 = 330.72
  • 9. UDP Packet Trace UDP Response Time: 1000321.12-1000000.96=320.16 Response Time ( micro. sec) TCP 330.72 UDP 320.16 2.4 Inference: Response time of TCP is greater than UDP. Since TCP performs three way handshake mechanisms, for each packet it has to wait for an acknowledgement. But in case of UDP, there is no acknowledgement. Hence compared to TCP, UDP has less Response
  • 10. 3.Simulation of different types of internet traffic such as FTP, TELNET over a network and analyzing the throughput 3.1 Theory: FTP is File Transfer Protocol that transfers the files from source to destination. It is an application layer protocol. The file transfer takes place over TCP. TELNET is Terminal 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 machine over TCP. 3.2 Procedure: 3.2.1 How to Create Scenario & Generate Traffic:  Create Scenario: “Simulation  New  Internetworks”. 3.2.2 Sample Inputs: FTP, Database, Voice, HTTP, Email, Peer to Peer and Video are the traffic types available as options in NetSim. To model other applications the “Custom” option is available. TELNET application has been modeled in NetSim by using custom traffic type. Packet Size and Packet Inter Arrival Time for TELNET application is shown below: Packet Size Distribution Constant Packet Size (Bytes) 1460 Packet Inter Arrival Time Distribution Constant Packet Inter Arrival Time (µs) 1500
  • 11. Fig 1: The Network Scenario In this experiment, 8 Wired Nodes and 3 Routers need to be clicked & dropped onto the Simulation environment. Wired Nodes A, B and C are connected to Router I. Wired Nodes E, F, G and H are connected to Router K. Wired Node D is connected to Router J. Router I and Router K are connected to Router J. The network scenario is shown in above fig 1. Then follow these steps: Sample 1: FTP Application from Wired Node D to Wired Node E. Sample 2: FTP Application from Wired Node D to Wired Node E. TELNET Application from Wired Node A to Wired Node F. Sample 3: FTP Application from Wired Node D to Wired Node E. TELNET Application from Wired Node A to Wired Node F. TELNET Application from Wired Node B to Wired Node G. Sample 4: FTP Application from Wired Node D to Wired Node E. TELNET Application from Wired Node A to Wired Node F. TELNET Application from Wired Node B to Wired Node G. TELNET Application from Wired Node C to Wired Node H. Note: Select “custom” for “TELNET” application TELNET FTP
  • 12. Inputs for the Sample experiment are given below: Set the following properties for all wired links. Wired Node Properties: Set the following properties for Wired Node D if application type is FTP and destination is Wired Node E. Set the following properties for Wired Node A if application type is TELNET and destination is Wired Node F. Node Properties Wired Node D Wired Node A Transport Layer Properties TCP Enable Enable Application Properties: (set the application property as per screenshot) Application Type FTP Custom(for TELNET) Source ID Wired Node D Wired Node A Destination ID Wired Node E Wired Node F Size Distribution Constant Constant Size (Bytes) 10000000 1460 Inter Arrival Time Distribution Constant Constant Inter Arrival Time 10 sec 1500 (µs) Router Properties: Accept default properties for the Router. Wired Link Properties: Set the following properties for all Wired Links. Link Properties All Wired Links Uplink Speed (Mbps) 1 Downlink Speed (Mbps) 1 Uplink BER No Error Downlink BER No Error Simulation Time - 100 Sec
  • 13. Upon completion of the experiment “Save” the experiments for comparisons which is carried out in the “Analytics” section and export to .csv to save the results. 3.2.3 Output: Open the Excel Sheet and note down the various throughputs as shown in the table below. These throughput values are available under application metrics in the metrics screen of NetSim. Experiment Number Source Destination Application Throughput 1 Wired Node D Wired Node E FTP 0.842595 2 Wired Node D Wired Node E FTP 0.662840 2 Wired Node A Wired Node F TELNET 0.257427 3 Wired Node D Wired Node E FTP 0.557720 3 Wired Node A Wired Node F TELNET 0.175550 3 Wired Node B Wired Node G TELNET 0.189917 4 Wired Node D Wired Node E FTP 0.486706 4 Wired Node A Wired Node F TELNET 0.146818 4 Wired Node B Wired Node G TELNET 0.142262 4 Wired Node C Wired Node H TELNET 0.144949 3.2.3.1 Graph I 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 FTP 1 FTP + 1 TELNET 1 FTP + 2 TELNET 1 FTP + 3 TELNET FTPThroughput(Mbps) FTP Throughput
  • 14. 3.2.3.2 Graph II 3.2.4 Inference From Graph I it can be inferred that FTP throughput decreases as the number of 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. From Graph II it can be inferred that TELNET throughput of Wired Node 1 decreases as the number 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 link 5. Hence as the overall TELNET traffic over wired link 5 increases, the TELNET throughput of Wired Node 1 decreases. 0 0.05 0.1 0.15 0.2 0.25 0.3 1 FTP + 1 TELNET 1 FTP + 2 TELNET 1 FTP + 3 TELNET TELNETThroughput(Mbps) TELNET Throughput of Wired Node 1
  • 15. 4.Network Socket Programming 4.1 Objective Study of Socket Programming and Client – Server model 4.2 Theory: The socket is a fundamental concept to the operation of TCP/IP 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 socket on other. 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 sockets). There is a receiver (TCP) server, which listens to the sender (TCP) client communications. There can be two-way communication. 4.3 Algorithm: Server: 1. Create a socket using address family (AF_INET), type (SOCK_STREM) and protocol (TCP) 2. Initialize the address family, port no and IP address to communicate using sockets 3. Bind a local address and port number with a socket 4. Listen for an incoming socket connection 5. Accept an incoming connection attempt on a socket 6. Receive an incoming message 7. Write that incoming message to Output.txt 8. Send ACK to received socket 9. Call step 5 to receive the message once again 10. Close file 11. Close socket
  • 16. Client: 1. Create a socket using address family (AF_INET), type (SOCK_STREM) and protocol (TCP) 2. Initialize the address family, port no and IP address to communicate using sockets 3. Establish Connection with destination IP 4. Send the data using the socket id 5. Close the socket connection 4.4 Procedure: Step:1 To begin with the experiment, open NetSim Click on Programming from the menu bar and select PC to PC Communication and then 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. Follow the steps  Under Input there are two things, 1. When Operation is Client, then the Server’s IP Address (Ex: 192.168.1.2) should be given in the Server IP Address field. Select Mode Select Protocol Select Operation Click Run to start transmissionClick here to view Concept, Algorithm, and Pseudo Code & Flowchart
  • 17. 2. When Operation is Server, then the Server’s IP Address (Ex: 192.168.1.2) would be automatically filled in the Local IP Address field. If the Operation is Server, the scenario will be obtained as shown below, If the Operation is Client, the scenario will be obtained as shown below, Server Side Client Side
  • 18. Step:2 TCP  First the Server should click on the Run button after which the Client should click on the Run button to Create the socket  Client should click on the Connect button to establish the connection with server.  The Client should click on the Send button to transmit the data to the Server.  The Client should click on the Close button to terminate the Connection with Server.  If the Data is successfully transmitted then the Sent Data would be Received in the Server System. UDP  First the Server should click on the Run button after which the Client should click on the Run button to Create the socket  The Client should click on the Send button to transmit the data to the Server.  The Client should click on the Close button to terminate the Connection with Server.  If the Data is successfully transmitted then the Sent Data would be Received in the Server System. Enter Destination IP Address Enter data to be transmitted
  • 19. 4.4.1 Result: User Mode (TCP) For user to write their own C Code in NetSim and check the result, click on Interface Source Code (present in Help in the left pane). Open Dev C++ or any GNU C compiler based IDK and copy the code from the Interface Source Code. In User Mode, the user needs to edit the Interface Source Code at the following location. int fnTcpServer() { // Write your own code here return 0; } So the user needs to add the user code, create exe and attach it with NetSim to run. The User code which is to be added is given below int fnTcpServer() { /////* User code part start */ nSocketfd =(int) socket(AF_INET,SOCK_STREAM, 0); serv_addr.sin_family = AF_INET; serv_addr.sin_port = htons(SERVER_PORTNUMBER); serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); Received data
  • 20. nBindfd = bind(nSocketfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)); #ifndef _NETSIM_SAMPLE nListenfd = listen(nSocketfd, 5); #else nListenfd = listen(nSocketfd, 1); #endif nServerLen = sizeof(serv_addr); if (fnWriteOutput() == 1) { /*if socket creation,bind and listen failed function will terminate*/ closesocket(nSocketfd); return 0; } #ifndef _NETSIM_SAMPLE nNewsocketfd =(int) accept(nSocketfd, (struct sockaddr *) &cli_addr, &nServerLen); nLoopCount++; memset(szData, 0, sizeof(szData)); /*Clear the array*/ nReceivedbytes =(int) recv(nNewsocketfd, szData, sizeof(szData), 0); fnWriteOutput(); nSendbytes =(int) send(nNewsocketfd, pszBuffer, strlen(pszBuffer), 0); #else while (1) { nNewsocketfd =(int) accept(nSocketfd, (struct sockaddr *) &cli_addr, &nServerLen); nLoopCount++; memset(szData, 0, sizeof(szData)); /*Clear the array*/ nReceivedbytes =(int) recv(nNewsocketfd, szData, sizeof(szData), 0); fnWriteOutput(); nSendbytes =(int) send(nNewsocketfd, pszBuffer, strlen(pszBuffer), 0); if( nTCPServerCloseFlag == 1) /*break the loop when user send close the connection*/ break; } #endif closesocket(nSocketfd); ////* User code part end */ return 0; } User Mode (UDP) For user to write their own C Code in NetSim and check the result, click on Interface Source Code (present in Help in the left pane). Open Dev C++ or any GNU C compiler based IDK and copy the code from the Interface Source Code. In User Mode, the user needs to edit the Interface Source Code at the following location. int fnUdpServer() { // Write your own code here
  • 21. return 0; } So the user needs to add the user code, create exe and attach it with NetSim to run. The User code which is to be added is given below int fnUdpServer() { /////* User code part start */ nSocketfd = (int)socket(AF_INET,SOCK_DGRAM, 0); /*Server side socket creation*/ serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); serv_addr.sin_port = htons(SERVER_PORTNUMBER); /* Server port number 6000*/ nServerLen = sizeof(serv_addr); nBindfd = bind(nSocketfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)); fnWriteOutput(); #ifndef _NETSIM_SAMPLE memset(szData, 0, sizeof(szData)); //Clear the array nReceivedbytes = recvfrom(nSocketfd, szData, sizeof(szData), 0,(struct sockaddr *) &serv_addr, &nServerLen); fnWriteOutput(); #else while(1) { memset(szData, 0, sizeof(szData)); //Clear the array nReceivedbytes = recvfrom(nSocketfd, szData, sizeof(szData), 0,(struct sockaddr *) &serv_addr, &nServerLen); fnWriteOutput(); } #endif closesocket(nSocketfd); /////* User code part end */ return 0; } Create .exe file (Appendix 2: Creating .exe file using Dev C++) In the left panel, select the Mode as User. Select the .exe file created above. Repeat the steps performed for Sample Mode and click Run. So presently NetSim will execute code written by the user and will display the result graphically. In case of any error, “ERROR IN USER CODE” message will be displayed.
  • 22. Note- How to practice this experiment without using NetSim Users who do not have a licensed version of NetSim in their PC's, can practice as explained below. First, run the exercise in sample mode. The user would see that an Input.txt file is created in Win OS temp folder (this can be reached by typing %temp%/NetSim in Windows run window). This input file should be read by the user code and it should generate an Output.txt. This Output.txt file is read by NetSim and shown graphically to the user. User can follow the steps provided in Appendix 1: Programming exercise - How to practice without NetSim. Given below are sample Input.txt and Output.txt files for this experiment for users to verify & validate their code. User must run the exe at both client and server and use the respective Input.txt file. Inside Input.txt file at Client system, use the server system IP address in “Destination IP Address” and client system IP address instead of “192.168.0.147:-Hello World” For TCP Input.txt file contents at Server system Protocol=TCP Operation=Server Input.txt file contents at Client system Protocol=TCP Operation=Client Destination IP Address=192.168.0.130 192.168.0.147:-Hello World Output.txt file contents at Server system Socket Created Bind Succeed Listen Succeed For UDP Input.txt file contents at Server system Protocol=UDP Operation=Server Input.txt file contents at Client system Protocol=UDP Operation=Client Destination IP Address=192.168.0.130 192.168.0.147:-Hello World Output.txt file contents at Server system Socket Created Bind Succeed
  • 23. 5.Simulating a three node point-to-point network and applying relevant applications over TCP and UDP 5.1 Objective: Simulate a three node point-to-point network with the links connected as follows: n0  n2, n1 n2 and n2  n3. Apply TCP agent between n0-n3 and UDP between n1-n3. Apply relevant applications over TCP and UDP agents changing the parameter and determine the number of packets sent by TCP / UDP. (n0, n1 and n3 are nodes and n2 is router). 5.2 Theory: TCP: TCP recovers data that is damaged, lost, duplicated, or delivered out of order by the internet communication system. This is achieved by assigning a sequence number to each octet transmitted, and requiring a positive acknowledgment (ACK) from the receiving TCP. If the ACK is not received within a timeout interval, the data is retransmitted. At the receiver side sequence number is used to eliminate the duplicates as well as to order the segments in correct order since there is a chance of “out of order” reception. Therefore, in TCP no transmission errors will affect the correct delivery of data. UDP: 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. 5.3 Procedure: To Create Scenario, goto Simulation  New  Internetworks. Click & drop Router, Wired Nodes and Application onto the Simulation Environment from tool bar as shown below.
  • 24. 5.3.1 Sample Inputs: Sample 1 Set the properties for the devices and links as shown below: Wired Node Properties: Wired Node Properties Wired Node B Wired Node C Transport Layer Properties TCP Enable Disable UDP Disable Enable Application Properties: Application Type Custom Custom Source ID 2(Wired Node B) 3(Wired Node C) Destination ID 4(Wired Node D) 4(Wired Node D) Packet Size Distribution Constant Constant Value(Bytes) 1460 1460 Inter Arrival Time Distribution Constant Constant Value(µs) 10000 10000 To add an application, click add button in application property
  • 25. Router Properties: Accept the default properties for Router. Wired Link Properties: Accept the default properties for all Wired Links. 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 and Application.  Then click on Run simulation). Sample 1: Wired Node B and Wired Node C transmit data to Wired Node D with the Packet Inter Arrival Time as 10000 µs. Likewise do the Sample 2 and Sample 3 by decreasing the Packet Inter Arrival Time as 5000 µs and 2500 µs respectively. (Note: “Packet Inter Arrival Time (µs)” field is available in Application Properties) Simulation Time - 100 Sec (Note: The Simulation Time can be selected only after doing the following two tasks,  Set the properties for Wired Nodes, Router, Wired Links and Application.  Then click on Run simulation). 5.3.2 Comparison Chart: (Note: The Number of Segments Sent, Segments Received and Datagram Sent, Datagram Received will be available in the TCP Metrics and UDP Metrics of “Performance Metrics” screen of NetSim) 5.3.2.1 Graph I (Note: The “Packets transmitted successfully” for TCP is Segments Received and for UDP is Datagram Received of the destination node i.e., Wired Node 3)
  • 26. Below Graph Shows Number of packets transmitted successfully in TCP and UDP 5.3.2.2 Graph II (Note: To get the “No. of packet lost”, For TCP, get the difference between Segments Sent and Segments Received and for UDP, get the difference between Datagram Sent and Datagram Received) Below Graph Shows Number of lost packets in TCP and UDP 0 5000 10000 15000 20000 25000 30000 35000 40000 45000 Exp 1 Exp 2 Exp 3 PacketsTransmittedSuccessfully Inter arrival time (Micro Sec) TCP vs UDP TCP UDP 0 10 20 30 40 50 60 70 80 90 100 Exp 1 Exp 2 Exp 3 No.ofPacketLost Experiment List TCP UDP
  • 27. 5.3.3 Inference: Graph I, shows that the number of successful packets transmitted in TCP is greater than (or equal to) UDP. Because, when TCP transmits a packet containing data, it puts a copy on a retransmission queue and starts a timer; when the acknowledgment for that data is received, the segment is deleted from the queue. If the acknowledgment is not received 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 not retransmit 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.
  • 28. 6.Stop & Wait Protocol Objective: Write a C/C++ program to implement stop & wait protocol. 6.1 Theory: Stop and Wait is a reliable transmission flow control protocol. This protocol works only in Connection Oriented (Point to Point) Transmission. The Source node has window size of ONE. After transmission of a frame the transmitting (Source) node waits for an Acknowledgement from the destination node. If the transmitted frame reaches the destination without error, the destination transmits a positive acknowledgement. If the transmitted frame reaches the Destination with error, the receiver destination does not transmit an acknowledgement. If the transmitter receives a positive acknowledgement it transmits the next frame if any. Else if its acknowledgement receive timer expires, it retransmits the same frame. 6.2 Algorithm: Start with the window size of 1 from the transmitting (Source) node.After transmission of a frame the transmitting (Source) node waits for a reply (Acknowledgement) from the receiving (Destination) node. If the transmitted frame reaches the receiver (Destination) without error, the receiver (Destination) transmits a Positive Acknowledgement. If the transmitted frame reaches the receiver (Destination) with error, the receiver (Destination) do not transmit acknowledgement. If the transmitter receives a positive acknowledgement it transmits the next frame if any. Else if the transmission timer expires, it retransmits the same frame again.
  • 29. If the transmitted acknowledgment reaches the Transmitter (Destination) without error, the Transmitter (Destination) transmits the next frame if any. If the transmitted frame reaches the Transmitter (Destination) with error, the Transmitter (Destination) transmits the same frame. This concept of the Transmitting (Source) node waiting after transmission for a reply from the receiver is known as STOP and WAIT. 6.3 Procedure: Step 1: To begin with the experiment, open NetSim Click on Programming from the menu bar and select Transmission Flow Control. The scenario is as shown in the following two figures. Next the following window appears and its description is given. When you select the User mode, you have to write your own program in C/C++, compile and link to NetSim software for validation. Click on the F1 (help) icon for details on how to proceed with your own code. Continue with the steps as given for sample mode. As soon as you begin to enter the input data file the following window appears and you select the input data file from where you have stored. Click Run to execute program Click here to view concept, algorithm, pseudo Code & flow chart Enter input & error rate Stop & Wait Select Mode
  • 30. 6.4 Result: Click Run button to view the output. 6.5 Inference: Due to increase in the error rate, no of errored packets also increase. If errored packets increase no of retransmitted packets also increase. Step 2: For user to write their own C Code in NetSim and check the result, click on Interface Source Code (present in Help in the left pane). Open Dev C++ or any GNU C compiler based IDK and copy the code from the Interface Source Code. The user needs to edit the Interface Source Code at the following location. void stopandwait(int errrate) { Data file that is added Output table
  • 31. // Write your own code here } So the user needs to add the user code, create exe and attach it with NetSim to run. The User code which is to be added is given below void stopandwait(int errrate) { /////* User code part start */ // Repeat the loop until transmission list of the transmitting // node becomes empty while(nodelist_sw->txframe != NULL) { // Get the current transmitting frame reference transframe_sw = ret_txframe_SW (); // Write the content into the output file. Data Value is written //into the file fprintf(fp_sw,"DT>%d>%s>%s>n",transframe_sw->iframe,transframe_sw- >szsrcaddr,transframe_sw->szdestaddr); /* Call the default function defined in the header file main1.h Store the return value to the local variable iret_sw. The Passed arguments 1. errrate -- This is the variable passed to the function (got from the function call of the retErrorrate) 2. transframe_sw -- This is Eth_frame_sw reference that has the Transmitting frame got from the function call ret_txframe_SW */ iret_sw=intro_error_SW(errrate,transframe_sw); // Write the content into the output file. Error value is written into //the file fprintf(fp_sw,"EV>%d>%s>%s>n",iret_sw,transframe_sw- >szsrcaddr,transframe_sw->szdestaddr); // Check if the frame is Positive or Negative if(iret_sw == 0)// Positive acknowledgment in the network { // Form the Ack frame according to the iret_sw value form_ack_SW (transframe_sw,1);// Positive Acknowledgement // Call the ret_ackframe_sw function and get the acknowledgement frame //reference from the tranmitting list of the receiving node ackframe_sw=ret_ackframe_sw (); // Write the content into the file. Positive Ack value fprintf(fp_sw,"ACK>POS>%s>%s>n",ackframe_sw- >szsrcaddr,ackframe_sw->szdestaddr); // Acknowledgement frame is made so delete the transmitted frame from //the transmitting list of the source node del_frame_SW(transframe_sw ->ipack,transframe_sw ->iframe); // User defined function call to delete the Acknowledgement frame del_ackframe_sw (); } } /////* User code part end */ } Create .exe file (Appendix 2: Creating .exe file using Dev C++) In the left panel, select the Mode as User. Select the .exe file created above.
  • 32. Select Stop and Wait and the Bit Error Rate (No Error or Error). Create a small text file (within 15000 bytes) and set it as input. Click Run. So presently NetSim will run Stop and Wait code which is written by the user and will display the result graphically. In case of any error, “ERROR IN USER CODE” message will be displayed. NOTE: Please insert the correct code according to the algorithm selected. The codes for other algorithm are provided in NetSim Installation CD. Note- How to practice this experiment without using NetSim: Users who do not have a licensed version of NetSim in their PC's, can practice as explained below. First, run the exercise in sample mode. The user would see that an Input.txt file is created in Win OS temp folder (this can be reached by typing %temp%/NetSim in Windows run window). This input file should be read by the user code and it should generate an Output.txt. This Output.txt file is read by NetSim and shown graphically to the user. User can follow the steps provided in Appendix 1: Programming exercise - How to practice without NetSim. Given below are sample Input.txt and Output.txt files for this experiment for users to verify & validate their code. The Output.txt file will vary based on the Data_file. In this case, the Data_File file contains the text “a”. Input.txt file contents Algorithm=Stop_and_Wait Data_File=C:UsersNirjharDesktopdata.txt> BER=0 *Note- Create any file of size <15000 Byte. Type the location of the file in Data_File. Output.txt file contents DT>1>node1>node2> EV>0>node1>node2> ACK>POS>node2>node1> *Note- Output.txt content will vary depending on the file contents.
  • 33. 7.Go Back N Protocol Objective: Write a C/C++ program to implement Go Back N protocol. 7.1 Theory: Go Back N is a connection oriented transmission. The sender transmits the frames continuously. Each frame in the buffer has a sequence number starting from 1 and increasing up to the window size. The sender has a window i.e. a buffer to store the frames. This buffer size is the number of frames to be transmitted continuously. The size of the window depends on the protocol designer. 7.2 Operations: A station may send multiple frames as allowed by the window size. Receiver sends an negative ACK if frame i has an error. After that, the receiver discards all incoming frames until the frame with error is correctly retransmitted. If sender receives a negative ACK it will retransmit frame i and all packets i+1, i+2, ... which have been sent, but not been acknowledged.
  • 34. 7.3 Algorithm: The source node transmits the frames continuously. Each frame in the buffer has a sequence number starting from 1 and increasing up to the window size. The source node has a window i.e. a buffer to store the frames. This buffer size is the number of frames to be transmitted continuously. The size of the window depends on the protocol designer. For the first frame, the receiving node forms a positive acknowledgement if the frame is received without error. If subsequent frames are received without error (up to window size) cumulative positive acknowledgement is formed. If the subsequent frame is received with error, the cumulative acknowledgment error-free frames are transmitted. If in the same window two frames or more frames are received with error, the second and the subsequent error frames are neglected. Similarly even the frames received without error after the receipt of a frame with error are neglected. The source node retransmits all frames of window from the first error frame. If the frames are errorless in the next transmission and if the acknowledgment is error free, the window slides by the number of error-free frames being transmitted. If the acknowledgment is transmitted with error, all the frames of window at source are retransmitted, and window doesn‟t slide. This concept of repeating the transmission from the first error frame in the window is called as GOBACKN transmission flow control protocol. 7.4 Procedure Step 1: To begin with the experiment, open NetSim. Click on Programming from the menu bar and select Transmission Flow Control. The scenario will be as shown in the following two figures.
  • 35. Next the following window appears and its description is given. When you select the User mode, you have to write your own program in C/C++, compile and link to NetSim software for validation. Click on F1 (help) for details on how to proceed with your own code. Continue with the steps as given for sample mode. As soon as you begin to enter the input data file the following window appears and you select the input data file from where you have stored. Click here to view Concept, Algorithm, Pseudo Code and Flow chart Click Run to execute program Enter input & bit error rate Go Back N Select Mode Data file that is added
  • 36. 7.5 Result: Click Run to view the output. Step 2: For user to write their own C Code in NetSim and check the result, click on Interface Source Code (present in Help in the left pane). Open Dev C++ or any GNU C compiler based IDK and copy the code from the Interface Source Code. The user needs to edit the Interface Source Code at the following location. void GoBackN(int derrValue) { // Write your own code here } So the user needs to add the user code, create exe and attach it with NetSim to run. The User code which is to be added is given below void GoBackN(int derrValue) { /////* User code part start */ // This szfilename variable has the output file path where the user has to // write his output framelist = nodelist->txframe; // Store Transmission list of the source //node to the local Eth_frame variable. // Repeat the loop until transmission list becomes empty while (nodelist->txframe != NULL) { ialreadyerror = 0;// Already Error flag value as 0 // Call the default function defined in the main.h. isliindex = slidingcount();// Returns the number of frames to be Output table
  • 37. //transmitted in the current window. // Write the content into the output file. Slinding Window count // is written into the file. fp = fopen(szfilename, "a+"); fprintf(fp, "CNT>%d>FRAMES>TRANSMIT>n", isliindex); fclose(fp); // Get the first frame from the transmission list transframe = rettxframe(-1, -1); // Make the looping for isliindex variable for (iloop = 0; iloop < isliindex; iloop++) { // Write the content into the output file. Data Value is // written into the file. fp = fopen(szfilename, "a+"); fprintf(fp, "DT>%d>%s>%s>n", transframe->iframe, transframe->szsrcaddr, transframe->szdestaddr); fclose(fp); /* Call the default function defined in the header file main1.h Store the return value to the local variable iret. The Passed arguments 1. derrValue -- This is the variable passed to the function (got from the function call of the retErrorrate) 2. transframe -- This is Eth_frame reference that has the Transmitting frame got from the function call ret_txframe */ iret = intro_error(derrValue, transframe); // Write the content into the output file. Error value is // written into the file fp = fopen(szfilename, "a+"); fprintf(fp, "EV>%d>%s>%s>n", iret, transframe->szsrcaddr, transframe->szdestaddr); fclose(fp); if (iret == 0)//No Error condition { if (ialreadyerror == 0) // Check for the Error Flag is 0 { formack(transframe); // Means Cumulative acknowledgement // frame formation } else { } } else // Error Condition ialreadyerror = 1; // Make the Already Error flag value as 1. // Call the user defined function to get the next transmission // frame of the transmitting node. transframe = rettxframe(transframe->ipack, transframe->iframe); } // Call the user defined function to get the acknowledgement frame ackframe = ret_ackframe(); // Store the current transmission list reference of the transmitting // node from the local variable framelist. nodelist->txframe = framelist; if (ackframe != NULL)// There is some positive acknowledgement formed { // Write the content into the file. Positive Ack value
  • 38. fp = fopen(szfilename, "a+"); fprintf(fp, "ACK>POS>%s>%s>n", ackframe->szsrcaddr, ackframe->szdestaddr); fclose(fp); for (iloop = 0; iloop < ackframe->iseq; iloop++) { // Call the function to delete the frame from the transmission // list of the transmitting node. framelist = deltxframe(); } // Write the content into the file. Number of frames deleted // from the source node. fp = fopen(szfilename, "a+"); fprintf(fp, "DEL>%d>FRAME>DELETED>n", ackframe->iseq); fclose(fp); } // Call the user defined function to delete the acknowledgement frame //from the transmission list of the destination node. del_ackframe(); } /////* User code part end */ } Create .exe file (Appendix 2: Creating .exe file using Dev C++) In the left panel, select the Mode as User. Select the .exe file created above. Select Go Back N and the Bit Error Rate (No Error or Error). Create a small text file (within 15000 bytes) and set it as input. Click Run. So presently NetSim will run Go Back N code which is written by the user and will display the result graphically. In case of any error, “ERROR IN USER CODE” message will be displayed. NOTE: Please insert the correct code according to the algorithm selected. The codes for other algorithm are provided in NetSim Installation CD. Note- How to practice this experiment without using NetSim: Users who do not have a licensed version of NetSim in their PC's, can practice as explained below. First, run the exercise in sample mode. The user would see that an Input.txt file is created in Win OS temp folder (this can be reached by typing %temp%/NetSim in Windows run window). This input file should be read by the user code and it should generate an Output.txt. This Output.txt file is read by NetSim and shown graphically to the user. User can follow the steps provided in Appendix 1: Programming exercise - How to practice without NetSim.
  • 39. Given below are sample Input.txt and Output.txt files for this experiment for users to verify & validate their code. The Output.txt file will vary based on the Data_file. In this case, the Data_File file contains the text “a”. Input.txt file contents Algorithm=Go_Back_N Data_File=C:UsersNirjharDesktopdata.txt> BER=0 *Note- Create any file of size <15000 Byte. Type the location of the file in Data_File. Output.txt file contents CNT>1>FRAMES>TRANSMIT> DT>1>node1>node2> EV>0>node1>node2> ACK>POS>node2>node1> DEL>1>FRAME>DELETED> *Note- Output.txt content will vary depending on the file contents
  • 40. 8.Selective Repeat Protocol Objective: Write a C/C++ program to implement Selective Repeat protocol. 8.1 Theory: Selective repeat is Similar to Go Back N. However, the sender only retransmits that frame for which a negative ACK is received Advantage over Go Back N:  Fewer retransmissions. Disadvantages:  More complexity at sender and receiver.  Receiver may receive frames out of sequence. Operations: A station may send multiple frames as allowed by the window size. Receiver sends a negative ACK if frame i has an error. After that, the receiver does not discard all incoming frames as in Go Back N. If sender receives a negative ACK it will retransmit only frame i which is the error frame.
  • 41. 8.2 Algorithm: The source node transmits the frames continuously. Each frame in the buffer has a sequence number starting from 1 and increasing up to the window size. The source node has a window i.e. a buffer to store the frames. This buffer size is the number of frames to be transmitted continuously. The receiver has a buffer to store the received frames. The size of the buffer depends upon the window size defined by the protocol designer. The size of the window depends according to the protocol designer. The source node transmits frames continuously till the window size is exhausted. If any of the frames are received with error only those frames are requested for retransmission (with a negative acknowledgement) If all the frames are received without error, a cumulative positive acknowledgement is sent. If there is an error in frame 3, an acknowledgement for the frame 2 is sent and then only Frame 3 is retransmitted. Now the window slides to get the next frames to the window. If acknowledgment is transmitted with error, all the frames of window are retransmitted. Else ordinary window sliding takes place. (* In implementation part, Acknowledgment error is not considered) If all the frames transmitted are errorless the next transmission is carried out for the new window. This concept of repeating the transmission for the error frames only is called Selective Repeat transmission flow control protocol. 8.3 Procedure Step 1: To begin with the experiment, open NetSim. Click on Programming from the menu bar and select Transmission Flow Control. Next the following window appears and its description is given.
  • 42. When you select the User mode, you have to write your own program in C/C++, compile and link to NetSim software for validation. Click on the F1 (help) for details on how to proceed with your own code. Continue with the steps as given for sample mode. As soon as you begin to enter the input data file the following window appears and you select the input data file from where you have stored. Click here to view Concept, Algorithm, and Pseudo Code & Flow chart Click Run to execute the program Enter input & bit error rate Selective Repeat Select mode Data file that is added
  • 43. 8.4 Result: Click Run to view the output. Step 2: For user to write their own C Code in NetSim and check the result, click on Interface Source Code (present in Help in the left pane). Open Dev C++ or any GNU C compiler based IDK and copy the code from the Interface Source Code. The user needs to edit the Interface Source Code at the following location. void SelRepeat(int nErrValue) { // Write your own code here } So the user needs to add the user code, create exe and attach it with NetSim to run. The User code which is to be added is given below void SelRepeat(int nErrValue) { /////* User code part start */ // This szfilename_SR variable has the output file path where the user has to write his output framelist_SR = nodelist_SR->txframe;// Store Transmission list of the source node to the local Eth_frame_SR variable. Output table
  • 44. for(iloop_SR=0;iloop_SR<7;iloop_SR++) { szBuffer_SR[iloop_SR] = 0; } // Make the nCurrentFrame_SR as 0, That is the first frame of the window is going to be transmitted nCurrentFrame_SR = 0; // Repeat the loop until all the frames has been transmitted in the network while(nodelist_SR->txframe != NULL) { icount_SR = 0; // Get the first frame for the transmission transframe_SR=retseltxframe(-1,-1); isliindex_SR = fnFrameCount_SR();// Get the count of number of frames to be transmitted in the medium // Write the content into the file fp_SR = fopen(szfilename_SR,"a+"); fprintf(fp_SR,"CNT>%d>FRAMES>TRANSMIT>n",isliindex_SR); fclose(fp_SR); ialreadyerror_SR = 0; // A flag value to say the error has been introduced in the network for(iloop_SR=0;iloop_SR<isliindex_SR;iloop_SR++) { // Store the temporary packet number,frame number in the local variable ipackno_SR=transframe_SR->ipack; iframeno=transframe_SR->iframe; // Open the file in appending mode fp_SR = fopen(szfilename_SR,"a+"); fprintf(fp_SR,"DT>%d>%s>%s>n",transframe_SR- >iframe,transframe_SR->szsrcaddr,transframe_SR->szdestaddr); fclose(fp_SR); // Call the inbuild function to make error in the frame iret_SR = intro_error_SR(nErrValue,transframe_SR); fp_SR = fopen(szfilename_SR,"a+"); fprintf(fp_SR,"EV>%d>%s>%s>n",iret_SR,transframe_SR- >szsrcaddr,transframe_SR->szdestaddr); fclose(fp_SR); if(iret_SR == 0)// No Error in the frame { // Make the frame has been received. szBuffer_SR[(transframe_SR->iseq) - 1] = 1; } // Call the function to get the next transmission frame transframe_SR=retseltxframe(ipackno_SR,iframeno); } // Store the transmission back to the original position nodelist_SR->txframe = framelist_SR; // Formation of the acknowledgement formselack(); // Get the acknowledgement frame of the transmission ackframe_SR = retselackframe_SR(); if(ackframe_SR == NULL) { } else// Some frames has been received { fp_SR = fopen(szfilename_SR,"a+"); fprintf(fp_SR,"ACK>POS>%s>%s>n",ackframe_SR- >szsrcaddr,ackframe_SR->szdestaddr); fclose(fp_SR); // Loop to delete the frames for(iloop_SR=0;iloop_SR<ackframe_SR->iseq;iloop_SR++)
  • 45. { framelist_SR=delseltxframe(); } fp_SR = fopen(szfilename_SR,"a+"); fprintf(fp_SR,"DEL>%d>FRAME>DELETED>n",ackframe_SR->iseq); fclose(fp_SR); } } /////* User code part end */ } Create .exe file (Appendix 2: Creating .exe file using Dev C++) In the left panel, select the Mode as User. Select the .exe file created above. Select Selective Repeat and the Bit Error Rate (No Error or Error). Create a small text file (within 15000 bytes) and set it as input. Click Run. So presently NetSim will run Selective Repeat code which is written by the user and will display the result graphically. In case of any error, “ERROR IN USER CODE” message will be displayed. NOTE: Please insert the correct code according to the algorithm selected. The codes for other algorithm are provided in NetSim Installation CD. Note- How to practice this experiment without using NetSim: Users who do not have a licensed version of NetSim in their PC's, can practice as explained below. First, run the exercise in sample mode. The user would see that an Input.txt file is created in Win OS temp folder (this can be reached by typing %temp%/NetSim in Windows run window). This input file should be read by the user code and it should generate an Output.txt. This Output.txt file is read by NetSim and shown graphically to the user. User can follow the steps provided in Appendix 1: “Programming exercise - How to practice without NetSim”. Given below are sample Input.txt and Output.txt files for this experiment for users to verify & validate their code. The Output.txt file will vary based on the Data_file. In this case, the Data_File file contains the text “a”.
  • 46. Input.txt file contents Algorithm=Selective_Repeat Data_File=C:UsersNirjharDesktopdata.txt> BER=0 *Note- Create any file of size <5000 Byte. Type the location of the file in Data_File. Output.txt file contents CNT>1>FRAMES>TRANSMIT> DT>1>node1>node2> EV>0>node1>node2> ACK>POS>node2>node1> DEL>1>FRAME>DELETED> *Note- Output.txt content will vary depending on the file contents.
  • 47. 9.Study the throughputs of Slow start + Congestion avoidance (Old Tahoe) and Fast Retransmit (Tahoe) Congestion Control Algorithms 9.1 Theory: One of the important functions of a TCP Protocol is congestion control in the network. Given below is a description of how Old Tahoe and Tahoe variants (of TCP) control congestion. Old Tahoe: Congestion can occur when data arrives on a big pipe (i.e. a fast LAN) and gets sent out through a smaller pipe (i.e. a slower WAN). Congestion can also occur when multiple input streams arrive at a router whose output capacity is less than the sum of the inputs. Congestion avoidance is a way to deal with lost packets. The assumption of the algorithm is that the packet loss caused by damaged is very small (much less than 1%), therefore the loss of a packet signals congestion somewhere in the network between the source and destination. There are two indications of packets loss: a timeout occurring and the receipt of duplicate ACKs Congestion avoidance and slow start are independent algorithms with different objectives. But when congestion occurs TCP must slow down its transmission rate and then invoke slow start to get things going again. In practice they are implemented together. Congestion avoidance and slow start requires two variables to be maintained for each connection: a Congestion Window (i.e. cwnd) and a Slow Start Threshold Size (i.e. ssthresh). Old Tahoe algorithm is the combination of slow start and congestion avoidance. The combined algorithm operates as follows, 1. Initialization for a given connection sets cwnd to one segment and ssthresh to 65535 bytes. 2. When congestion occurs (indicated by a timeout or the reception of duplicate ACKs), one-half of the current window size (the minimum of cwnd and the receiver‟s advertised
  • 48. window, but at least two segments) is saved in ssthresh. Additionally, if the congestion is indicated by a timeout, cwnd is set to one segment (i.e. slow start). 3. When new data is acknowledged by the other end, increase cwnd, but the way it increases depends on whether TCP is performing slow start or congestion avoidance. If cwnd is less than or equal to ssthresh, TCP is in slow start. Else TCP is performing congestion avoidance. Slow start continues until TCP is halfway to where it was when congestion occurred (since it recorded half of the window size that caused the problem in step 2). Then congestion avoidance takes over. Slow start has cwnd begins at one segment and be incremented by one segment every time an ACK is received. As mentioned earlier, this opens the window exponentially: send one segment, then two, then four, and so on. Congestion avoidance dictates that cwnd be incremented by 1/cwnd, compared to slow start‟s exponential growth. The increase in cwnd should be at most one segment in each round trip time (regardless of how many ACKs are received in that RTT), whereas slow start increments cwnd by the number of ACKs received in a round-trip time. Tahoe (Fast Retransmit): The Fast retransmit algorithms operating with Old Tahoe is known as the Tahoe variant. TCP may generate an immediate acknowledgement (a duplicate ACK) when an out-of-order segment is received out-of-order, and to tell it what sequence number is expected. Since TCP does not know whether a duplicate ACK is caused by a lost segment or just a re- ordering of segments, it waits for a small number of duplicate ACKs to be received. It is assumed that if there is just a reordering of the segments, there will be only one or two duplicate ACKs before the re-ordered segment is processed, which will then generate a new ACK. If three or more duplicate ACKs are received in a row, it is a strong indication that a segment has been lost. TCP then performs a retransmission of what appears to be the missing segment, without waiting for a re-transmission timer to expire. 9.2 Procedure: Go to Simulation  New  Internetworks
  • 49. Sample Inputs: Follow the steps given in the different samples to arrive at the objective. Sample 1.a: Old Tahoe (1 client and 1 server) In this Sample,  Total no of Node used: 2  Total no of Routers used: 2 The devices are inter connected as given below,  Wired Node C is connected with Router A by Link 1.  Router A and Router B are connected by Link 2.  Wired Node D is connected with Router B by Link 3. Set the properties for each device by following the tables, Application Properties Application Type Custom Source_Id 4(Wired Node D) Destination_Id 3(Wired Node C) Packet Size Distribution Constant Value (bytes) 1460 Inter Arrival Time Distribution Constant Value (micro secs) 1300
  • 50. Node Properties: In Transport Layer properties, set TCP Properties MSS(bytes) 1460 Congestion Control Algorithm Old Tahoe Window size(MSS) 8 Router Properties: Accept default properties for Router. Link Properties Link 1 Link 2 Link 3 Max Uplink Speed (Mbps) 8 10 8 Max Downlink Speed(Mbps) 8 10 8 Uplink BER 0.000001 0.000001 0.000001 Downlink BER 0.000001 0.000001 0.000001 Simulation Time - 10 Sec Upon completion of simulation, “Save” the experiment. (Note: The Simulation Time can be selected only after doing the following two tasks,  Set the properties of Node, Router& Link  Then click on Run Simulation button). Sample 1.b: Tahoe (1 client and 1 server) Open sample 1.a, and change the TCP congestion control algorithm to Tahoe (in Node Properties). Upon completion of simulation, “Save” the experiment as sample 1.b. Sample 2.a: Old Tahoe (2 clients and 2 servers) In this Sample,
  • 51.  Total no of Wired Nodes used: 4  Total no of Routers used: 2 The devices are inter connected as given below,  Wired Node A and Wired Node B are connected with Router C by Link 1 and Link 2.  Router C and Router D are connected by Link 3.  Wired Node E and Wired Node F are connected with Router D by Link 4 and Link 5.  Wired Node A and Wired Node B are not transmitting data in this sample. Set the properties for each device by following the tables, Application Properties Application 1 Application 2 Application Type Custom Source_Id 5 6 Destination_Id 1 2 Packet Size Distribution Constant Constant Value (bytes) 1460 1460 Inter Arrival Time Distribution Constant Constant Value (micro secs) 1300 1300 Node Properties: In Transport Layer properties, set TCP Properties MSS(bytes) 1460 Congestion Control Algorithm Old Tahoe Window size(MSS) 8
  • 52. Router Properties: Accept default properties for Router. Link Properties Link 1 Link 2 Link 3 Link 4 Link 5 Max Uplink Speed (Mbps) 8 8 10 8 8 Max Downlink Speed (Mbps) 8 8 10 8 8 Uplink BER 0.000001 0.000001 0.000001 0.000001 0.000001 Downlink BER 0.000001 0.000001 0.000001 0.000001 0.000001 Simulation Time - 10 Sec Upon completion of simulation, “Save” the experiment. (Note: The Simulation Time can be selected only after doing the following two tasks,  Set the properties of Node , Router & Link  Then click on Run Simulation button). Sample 2.b: Tahoe (2 clients and 2 servers) Do the experiment as sample 2.a, and change the congestion control algorithm to Tahoe. Upon completion of simulation, “Save” the experiment. Sample 3.a: Old Tahoe (3 clients and 3 servers) In this Sample,
  • 53.  Total no of Nodes used: 6  Total no of Routers used: 2 The devices are inter connected as given below,  Wired Node A, Wired Node B & Wired Node C is connected with Router D by Link 1, Link 2 & Link 3.  Router D and Router E are connected by Link 4.  Wired Node F, Wired Node G & Wired Node H is connected with Router E by Link 5, Link 6 & Link 7.  Wired Node A, Wired Node B and Wired Node C are not transmitting data in this sample. Set the properties for each device by following the tables, Application Properties Application 1 Application 2 Application 3 Application Type Custom Source_Id 6 7 8 Destination_Id 1 2 3 Packet Size Distribution Constant Constant Constant Value (bytes) 1460 1460 1460 Inter Arrival Time Distribution Constant Constant Constant Value (micro sec) 1300 1300 1300 Node Properties: In Transport Layer properties, set TCP Properties MSS(bytes) 1460 1460 1460 Congestion Control Algorithm Old Tahoe Old Tahoe Old Tahoe Window size(MSS) 8 8 8
  • 54. Router Properties: Accept default properties for Router. Link Properties Link 1 Link 2 Link 3 Link 4 Link 5 Link 6 Link 7 Max Uplink Speed (Mbps) 8 8 8 10 8 8 8 Max Downlink Speed(Mbps) 8 8 8 10 8 8 8 Uplink BER 0.000001 0.000001 0.000001 0.000001 0.000001 0.000001 0.000001 Downlink BER 0.000001 0.000001 0.000001 0.000001 0.000001 0.000001 0.000001 Simulation Time- 10 Sec Upon completion of simulation, “Save” the experiment. (Note: The Simulation Time can be selected only after doing the following two tasks,  Set the properties of Node, Router & Link  Then click on Run Simulation button). Sample 3.b: Tahoe (3 clients and 3 servers) Do the experiment as sample 3.a, and change the TCP congestion algorithm to Tahoe. Upon completion of simulation, “Save” the experiment. 9.3 Output Comparison Table: TCP Downloads Metrics Slow start + Congestion avoidance Fast Retransmit 1 client and 1 server Throughput(Mbps) 5.926432 6.120320 Segments Retransmitted + Seg Fast Retransmitted 195 200 2 clients and 2 servers Throughput(Mbps) 8.796208 8.810224 Segments Retransmitted + Seg Fast Retransmitted 343 378 3 clients and 3 servers Throughput(Mbps) 9.144272 9.23304 Segments Retransmitted + Seg Fast Retransmitted 401 434
  • 55. Note: To calculate the “Throughput (Mbps)” for more than one application, add the individual application throughput which is available in Application Metrics (or Metrics.txt) of Performance Metrics screen. In the same way calculate the metrics for “Segments Retransmitted + Seg Fast Retransmitted” from TCP Metrics  Connection Metrics. 9.4 Inference: User lever throughput: User lever throughput of Fast Retransmit is higher when compared then the Old Tahoe (SS + CA). This is because, if a segment is lost due to error, Old Tahoe waits until the RTO Timer expires to retransmit the lost segment, whereas Tahoe (FR) retransmits the lost segment immediately after getting three continuous duplicate ACK‟s. This results in the increased segment transmissions, and therefore throughput is higher in the case of Tahoe.
  • 56. 10. Implementation of QoS in IEEE 802.11e Network 10.1 Theory: IEEE 802.11e Medium Access Control (MAC) is an emerging supplement to the IEEE 802.11 Wireless Local Area Network (WLAN) standard to support Quality-of-Service (QoS). The 802.11e MAC is based on both centrally-controlled and contention-based channel accesses. The standard is considered of critical importance for delay-sensitive applications. It offers all subscribers high-speed Internet access with video, audio, and voice over IP. 10.2 Procedure: Step 1: Go to Simulation  New  Internetworks Sample 1: Step 2: Create scenario as per the screen shot: Devices Required: 2 Wireless Node, 1 Access point, 1 Router, 1 Wired Node Step 3: Access Point Properties AP C Global Properties X_Coordinate 250 Y_Coordinate 100
  • 57. Step 4: Wireless Node Properties Wireless Node B Wireless Node C Global Properties X_Coordinate 300 250 Y_Coordinate 100 150 Step 5: Node properties: Disable TCP in all nodes in Transport layer as follows: Wireless Link Properties: Right click on Wireless link and Change the channel characteristics as “No Path Loss” Channel Characteristics No Path Loss Wired Link Properties: Right click on Wired link and Change the Bit Error Rate Wired Link Properties Bit Error Rate 0
  • 58. Access Point Properties: Right click on access point properties. In interface1_Wireless, enable IEEE802.11e and set the buffer size as 5 as shown in below figure:- Wireless Node Properties: Right click on Wireless Node and in Interface1_Wireless, enable IEEE802.11e. Step 6: Select the Application Button and click on the gap between the Grid Environment and the ribbon. Now right click on Application and select Properties as shown below: Application Type Voice (Codec -Custom) CBR Source ID 1 (Wired Node E) 1(Wired Node E) Destination ID 4 ( Wireless Node C) 5( Wireless Node B) Packet Size Distribution Constant Constant Value(Bytes) 1000 1000 Inter Arrival Time Distribution Constant Constant Value(µs) 800 800
  • 59. NOTE: The procedure to create multiple applications are as follows: Step 1: Click on the ADD button present in the bottom left corner to add a new application. Simulation Time – 10 sec After completion of the experiment, “Save” the experiment as Sample 1. Sample 2: Open Sample 1, and disable IEEE_802.11e in both Access point and Wireless Node properties and run the simulation for 10 seconds. 10.3 Output Comparison Table: IEEE 802.11e Application Generation rate (Mbps) Throughput (Mbps) Delay (Micro. Sec.) Enable Voice 10 4.67 2782736.5 CBR 10 0.0 0 Disable Voice 10 2.28 4099938.2 CBR 10 2.28 4100423.3
  • 60. 10.4 Inference 802.11e is a proposed enhancement to the 802.11a and 802.11b Wireless LAN (WLAN) specifications. It offers quality of service including which prioritization of voice, video and data transmissions. Hence Throughput is obtained for voice transmission.
  • 61. 11. Study the working and routing table formation of Interior routing protocols, i.e. Routing Information Protocol (RIP) and Open Shortest Path First (OSPF) 11.1 Theory: RIP RIP is intended to allow hosts and gateways to exchange information for computing routes through an IP-based network. RIP is a distance vector protocol which is based on Bellman- Ford algorithm. This algorithm has been used for routing computation in the network. Distance vector algorithms are based on the exchange of only a small amount of information using RIP messages. Each entity (router or host) that participates in the routing protocol is assumed to keep information about all of the destinations within the system. Generally, information about all entities connected to one network is summarized by a single entry, which describes the route to all destinations on that network. This summarization is possible because as far as IP is concerned, routing within a network is invisible. Each entry in this routing database includes the next router to which datagrams destined for the entity should be sent. In addition, it includes a "metric" measuring the total distance to the entity. Distance is a somewhat generalized concept, which may cover the time delay in getting messages to the entity, the dollar cost of sending messages to it, etc. Distance vector algorithms get their name from the fact that it is possible to compute optimal routes when the only information exchanged is the list of these distances. Furthermore, information is only exchanged among entities that are adjacent, that is, entities that share a common network. OSPF In OSPF, the Packets are transmitted through the shortest path between the source and destination. Shortest path: OSPF allows administrator to assign a cost for passing through a link. The total cost of a particular route is equal to the sum of the costs of all links that comprise the route. A router chooses the route with the shortest (smallest) cost.
  • 62. In OSPF, each router has a link state database which is tabular representation of the topology of the network (including cost). Using dijkstra algorithm each router finds the shortest path between source and destination. Formation of OSPF Routing Table 1. OSPF-speaking routers send Hello packets out all OSPF-enabled interfaces. If two routers sharing a common data link agree on certain parameters specified in their respective Hello packets, they will become neighbors. 2. Adjacencies, which can be thought of as virtual point-to-point links, are formed between some neighbors. OSPF defines several network types and several router types. The establishment of an adjacency is determined by the types of routers exchanging Hellos and the type of network over which the Hellos are exchanged. 3. Each router sends link-state advertisements (LSAs) over all adjacencies. The LSAs describe all of the router's links, or interfaces, the router's neighbors, and the state of the links. These links might be to stub networks (networks with no other router attached), to other OSPF routers, or to external networks (networks learned from another routing process). Because of the varying types of link-state information, OSPF defines multiple LSA types. 4. Each router receiving an LSA from a neighbor records the LSA in its link-state database and sends a copy of the LSA to all of its other neighbors. 5. By flooding LSAs throughout an area, all routers will build identical link-state databases. 6. When the databases are complete, each router uses the SPF algorithm to calculate a loop- free graph describing the shortest (lowest cost) path to every known destination, with itself as the root. This graph is the SPF tree. 7. Each router builds its route table from its SPF tree 11.2 Procedure Sample 1: Step 1: Go to Simulation  New  Internetworks
  • 63. Step 2: Click & drop Routers, Switches and Nodes onto the Simulation Environment and link them as shown: Step 3: These properties can be set only after devices are linked to each other as shown above. Set the properties of the Router 1 as follows: Node Properties: In Wired Node H, go to Transport Layer and set TCP as Disable Switch Properties: Accept default properties for Switch. Link Properties: Accept default properties for Link. Application Properties: Click and drop the Application icon and set properties as follows:
  • 64. Simulation Time - 100 Sec After Simulation is performed, save the experiment. (Note: The Simulation Time can be selected only after doing the following two tasks,  Set the properties of Node, Switch, Router& Application  Then click on Run Simulation button). Sample 2: To model a scenario, follow the same steps as given in Sample1 and set the Router A properties as given below:
  • 65. Link Properties: Link Properties Link 3 Link 4 Link 5 Link 6 Link 7 Uplink Speed 100 100 100 10 10 Downlink Speed 100 100 100 10 10 Node Properties: In Wired Node H, go to Transport Layer and set TCP as Disable Switch Properties: Accept default properties for Switch. Application Properties: Click and drop the Application icon and set properties as in Sample 1. Simulation Time- 100 Sec (Note: The Simulation Time can be selected only after doing the following two tasks,  Set the properties of Node, Switch, Router& Application  Then click on Run Simulation button). 11.3 Output and Inference: RIP In Distance vector routing, each router periodically shares its knowledge about the entire network with its neighbors. The three keys for understanding the algorithm, 1. Knowledge about the whole network Router sends all of its collected knowledge about the network to its neighbors 2. Routing only to neighbors Each router periodically sends its knowledge about the network only to those routers to which it has direct links. It sends whatever knowledge it has about the whole network through all of its ports. This information is received and kept by each neighboring router and used to update that router‟s own information about the network 3. Information sharing at regular intervals For example, every 30 seconds, each router sends its information about the whole network to its neighbors. This sharing occurs whether or not the network has changed since the last time information was exchanged
  • 66. In NetSim the Routing table Formation has 3 stages Initial Table: This table will show the direct connections made by each Router. Intermediate Table: The Intermediate table will have the updates of the Network in every 30 seconds Final Table: This table is formed when there is no update in the Network. The data should be forwarded using Routing Table with the shortest distance The RIP table in NetSim  After running Sample1, click RIP table in Performance Metrics screen. Then click the respective router to view the Routing table.  We have shown the routing table for Router 1, Shortest Path from Wired Node H to WiredNode I in RIP (Use Packet Animation to view) : WiredNode HSwitch FRouter1Router4Router5Switch GWired Node I OSPF
  • 67. The main operation of the OSPF protocol occurs in the following consecutive stages and leads to the convergence of the internetworks: 1. Compiling the LSDB. 2. Calculating the Shortest Path First (SPF) Tree. 3. Creating the routing table entries. Compiling the LSDB The LSDB is a database of all OSPF router LSAs. The LSDB is compiled by an ongoing exchange of LSAs between neighboring routers so that each router is synchronized with its neighbor. When the Network converged, all routers have the appropriate entries in their LSDB. Calculating the SPF Tree Using Dijkstra's Algorithm Once the LSDB is compiled, each OSPF router performs a least cost path calculation called the Dijkstra algorithm on the information in the LSDB and creates a tree of shortest paths to each other router and network with themselves as the root. This tree is known as the SPF Tree and contains a single, least cost path to each router and in the Network. The least cost path calculation is performed by each router with itself as the root of the tree Calculating the Routing Table Entries from the SPF Tree The OSPF routing table entries are created from the SPF tree and a single entry for each network in the AS is produced. The metric for the routing table entry is the OSPF-calculated cost, not a hop count. The OSPF table in NetSim  After running Sample 2, click OSPF Metrics in Performance Metrics screen. Then click the router to view the Routing table  We have shown the routing table for Router 1:
  • 68. Shortest Path from Wired Node H to WiredNode I in OSPF (Use Packet Animation to view): WiredNode HSwitch FRouter1Router2Router3Router5Switch G WiredNode I Note: The Cost is calculated by using the following formula Reference Bandwidth = 100 Mbps For Example, Let us take, Link Speed UP = 100 Mbps
  • 69. 12. Experiment on M/D/1 Queue: -To create an M/D/1 queue: a source to generate packets, a queue to act as the buffer and server, a sink to dispose of serviced packets. -To study how the queuing delay of such a system varies. 12.1 Theory: In systems where the service time is a constant, the M/D/1, single-server queue model, can be used. Following Kendall's notation, M/D/1 indicates a system where:  Arrivals are a Poisson process with parameter λ  Service time(s) is deterministic or constant  There is one server For an M/D/1 model, the total expected queuing time is Where µ = Service Rate = 1/Service time and  is the utilization given as follows, To model an M/D/1 system in NetSim, we use the following model Traffic flow from Node 1 to Node 2 (Node 1: Source, Node 2: Sink) Inter-arrival time: Exponential Distribution with mean 2000 µs Packet size: Constant Distribution with mean of 1250 bytes
  • 70. Note: 1. Exponentially distributed inter-arrivals times give us a Poisson arrival process. Different mean values are chosen as explained in the section Sample Inputs. (Dropping the devices in different order may change the result because the random number generator will get initialized differently) 2. To get constant service times, we use constant distribution for packet sizes. Since, the service (which in our case is link transmission) times are directly proportional to packet size (greater the packet size, greater the time for transmission through a link), a constant packet size leads to a constant service time. Procedure: Create Scenario: “Simulation  New  Internetworks”. Nodes 1 and Node 2 are connected with Router 1 by Link 1 and Link 2 respectively. Set the properties for each device as given below, Sample 1: Application Properties: Click and drop the Application icon and set following properties: Application Type Custom Source_Id 1 Destination_Id 2 Packet Size Distribution Constant Value (bytes) 1250 Inter Arrival Time Distribution Exponential Packet Inter Arrival Time (µs) 2000 Disable TCP in the Transport Layer in Node Properties as follows:
  • 71. Link Properties Link 1 Link 2 Uplink Speed (Mbps) 10 10 Downlink Speed (Mbps) 10 10 Uplink BER 0 0 Downlink BER 0 0 Uplink Propagation Delay (ms) 0 0 Downlink Propagation Delay (ms) 0 0 Router Properties: Accept the default properties for Router. Simulation Time: 100 Sec Observation: Even though the packet size at the application layer is 1250 bytes, as the packet moves down the layers, some overhead is added which results in a greater packet size. This is the actual payload that is transmitted by the physical layer. The overheads added in different layers are shown in the table: Therefore, the payload size = Packet Size + Overhead = 1250 + 54 = 1304 bytes Theoretical Calculation: By formula, µ = Service Rate, i.e., the time taken to service each packet Layer Overhead (Bytes) Transport Layer 8 Network Layer 20 MAC layer 26 Physical Layer 0 Total 54
  • 72. = Link capacity (bps) / (Payload Size (Bytes) * 8) = (10×106 ) / (1304*8) = 958.59 packets / sec λ = Arrival rate, i.e., the rate at which packets arrive (Packets per second) Inter-arrival time = 2,000 micro sec Arrival rate λ = 1/ Inter Arrival time = 1/2000 micro sec = 500 packets / sec ρ = Utilization = λ/µ = 500/958.59 = 0.522 By formula, Queuing Time = = 569.61 micro sec 12.2 Output: After running the simulation, check the “Delay” in the Application Metrics. Delay = 2656.855 micro sec This Delay (also known as Mean Delay) is the sum of Queuing Delay, Total Transmission time and Routing Delay. ( ) ( ) ( ) ( ) Total Transmission Time is the sum of transmission time through Link 1 and Link 2. Transmission time through each link is the same and is given by: Transmission time through each link = = = 1043.2 micro sec Routing Delay is approximately 1 micro sec and can be found from the Event Trace. It is the difference between “Physical In” and “Physical Out” time for the Router.
  • 73. Therefore, for simulation Queuing Delay = 2656.855– (2 × 1043.2) – 1 = 569.455 micro sec Sample 2 Keeping all the other parameters same as in previous example, if Packet Inter Arrival Time is taken as 1500 micro sec, then λ = 666.67 packets per sec Utilization ρ = λ/µ = 666.67/958.59 = 0.695 And Queuing Time T = 1188.56 micro sec From NetSim, Delay = 3279.297 micro sec Therefore, Queuing Time = 3279.298 - (2×1043.2) – 1 = 1191.898 micro sec Note: Obtained value is slightly higher than the theoretical value because of initial delays in forming ARP table, Switch table and Routing table etc. A Note on M/M/1 queuing in NetSim M/M/1 queue can be generated similarly by setting the “Packet Size Distribution” as “Exponential” instead of “Constant”. However, the results obtained from simulation deviate from the theoretical value because of the effect of packet fragmentation. Whenever a packet with size greater than Transport Layer MSS and / or MAC Layer MTU (which is 1500 bytes in NetSim) is generated, it gets fragmented in the application layer. Then the packet is sent as multiple frames, and makes it impossible to calculate the exact queuing time.
  • 74. 13. Datagram network Study theory from NetSim “Basic Menu Introductiondatagram” 14. Distance Vector Routing Objective: Write a C/C++ program to verify the distance vector routing algorithm 14.1 Theory: 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 forms the routing table and delivers the packets depending upon the routes in the table – either 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 Routing. 14.2 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 greater than the its neighbor‟s entry.  Write the next stage of routing table into the file.
  • 75. 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. 14.3 Procedure: To begin with the experiment, open NetSim Click on Programming from the menu bar and select Distance Vector Routing Step 1: The scenario will be obtained as shown below. Follow the steps. 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. Select the Mode Click Run to execute the Program Connect the Routers .
  • 76. 14.4 Results (to be filled up by the students): Step 2: For user to write their own C Code in NetSim and check the result, click on Interface Source Code (present in Help in the left pane). Open Dev C++ or any GNU C compiler based IDK and copy the code from the Interface Source Code. The user needs to edit the Interface Source Code at the following location. void fnDistVectAlgorithm() { // Write your own code here } So the user needs to add the user code, create exe and attach it with NetSim to run. The User code which is to be added is given below void fnDistVectAlgorithm() { /////* User code part start */ Output Table
  • 77. do// This do while... loop is to update the table information till it knows all the router's information present in the network. { // I for//To go to No of router for(nRouterTable=1;nRouterTable<=g_nNoOfRouters;nRouterTable++) {// II for //Select the source router for(nNeighbour=1;nNeighbour<=g_nNoOfRouters;nNeighbour++) {// III for//move to all router if(Table[nRouterTable].nCostID[nNeighbour]==1) {// I if //select the neigh router int nDestID=1; for(nDestID=1;nDestID<=g_nNoOfRouters;nDestID++) {// IV for //select the routing table of neigh if(nDestID!=nRouterTable) {// II if if((Table[nRouterTable].nDestID[nDestID] == 0) && (Table[nNeighbour].nDestID[nDestID]!=0))// || {// III if //This loop is to check whether the neighbour router is DESTINATION or not. Table[nRouterTable].nDestID[nDestID] = nDestID; Table[nRouterTable].nNextHop[nDestID] = nNeighbour; Table[nRouterTable].nCostID[nDestID]=(Table[nNeighbour].nCostID[nDestID]+1); } else if((Table[nRouterTable].nNextHop[nDestID]!=nDestID||Table[nRouterTable].nCostID[nDe stID]!=1)&&(Table[nNeighbour].nDestID[nDestID]!=0)) {// else if // This loop is to check whether the neighbour router is the destination or not and also check whether the cost ID is 1 or not. if(Table[nRouterTable].nCostID[nDestID]>Table[nNeighbour].nCostID[nDestID]) {//IV if //This loop is to find the least cost path Table[nRouterTable].nDestID[nDestID] = nDestID; Table[nRouterTable].nNextHop[nDestID] = nNeighbour; Table[nRouterTable].nCostID[nDestID]=(Table[nNeighbour].nCostID[nDestID]+1); }//end IV if }//end else if }// end II if }//end IV for }// end I if }//end III for }// end II for nStage++; fnDisplay(nStage); }while(nStage<2); /////* User code part end */ }
  • 78. Create .exe file (Appendix 2: Creating .exe file using Dev C++) In the left panel, select the Mode as User. Select the .exe file created above. Click on 1 router and another router consecutively to connect them. Click Run. So presently NetSim will run Distance Vector Routing code which is written by the user and will display the result graphically. In case of any error, “ERROR IN USER CODE” message will be displayed. Note- How to practice this experiment without using NetSim Users who do not have a licensed version of NetSim in their PC's, can practice as explained below. First, run the exercise in sample mode. The user would see that an Input.txt file is created in Win OS temp folder (this can be reached by typing %temp%/NetSim in Windows run window). This input file should be read by the user code and it should generate an Output.txt. This Output.txt file is read by NetSim and shown graphically to the user. User can follow the steps provided in Appendix 1: Programming exercise - How to practice without NetSim. Given below are sample Input.txt and Output.txt files for this experiment for users to verify & validate their code Input.txt file contents Router_ID=1>Router_Name=Router_1>No_Of_Neighbour=1>Neighbours_ID=2 Router_ID=2>Router_Name=Router_2>No_Of_Neighbour=4>Neighbours_ID=1>3>6>5 Router_ID=3>Router_Name=Router_3>No_Of_Neighbour=2>Neighbours_ID=2>4 Router_ID=4>Router_Name=Router_4>No_Of_Neighbour=2>Neighbours_ID=3>6 Router_ID=5>Router_Name=Router_5>No_Of_Neighbour=1>Neighbours_ID=2 Router_ID=6>Router_Name=Router_6>No_Of_Neighbour=2>Neighbours_ID=4>2 Output.txt file contents 0>1>2>1>0 0>2>1>1>0 0>2>3>1>0 0>2>5>1>0 0>2>6>1>0 0>3>2>1>0 0>3>4>1>0 0>4>3>1>0 0>4>6>1>0
  • 81. 15. IPV6 Addressing - EUI-64 Interface Identifier Programming Guidelines This section guides the user to link his/her own code for EUI 64 Interface Identifier to NetSim. Pre - Conditions The user program should read the inputted scenario from text file named „Input‟ with extension txt. The user program after executing the concept should write the required output to a file named „Output’ with extension txt. Note:The temporary directory is navigated through the following step. Run Type "%temp%"  NetSim  "Input.txt" and "Output.txt" (Note : To open Run Press Windows+R) General Program Flow The program begins with the Reading of the Inputs from the input file Input.txt. Executing the required concept and, The results of the program should be written into the output file Output.txt. File Format Input File Output File IPV6_Network_Id=2000:FE21:5931:72 C3 MAC_Address=11-11-FF-FF-12-34 The Output File format MAC Address> First part of MAC Address>Second part of MAC Address FF-EE appended Address> First byte value>Binary value of First byte> 7th bit value>Complement value of 7th bit Complemented binary value of First byte>Hexa decimal value of complemented binary value>
  • 82. Interface Id value> Interface Id in colon notation> IPV6 prefix value> IPV6 Address> Sample Output text Format 11-11-FF-FF-12-34> 11-11-FF>FF-12-34> 11-11-FF-FF-FE-FF-12-34> 11>00010001> 0>1> 00010011>13> 13-11-FF-FF-FE-FF-12- 34>1311:FFFF:FEFF:1234> 2000:FE21:5931:72C3> 2000:FE21:5931:72C3:1311:FFFF:FEFF:1234> Interface Source Code Interface source code written in C is given using this the user can write only the fnEUI64 () function using the variables already declared. To view the interface source code, go to NetSim Installation path / src / Programming/ IPV6EUI64.c To find NetSim‟s Installation path right click NetSim icon and select  Open file location in Windows 7  Open file location in Windows Vista  Properties  find target in Windows XP. Sample Scenarios: Objective - To understand the concept of EUI 64 Interface Identifier through programming. How to Proceed? - The objective can be executed in NetSim using the programming exercise available, under programming user has to select IPV6 Addressing  EUI 64 Interface Identifier, Sample Inputs - In the Input panel the following steps need to be done,  SampleMode should be selected.  Select the IPV6 Network Id (IPV6 Prefix)  Enter the MAC Address.
  • 83.  Then Run button need to be clicked. Refresh button can be used if new Inputs have to be given. Output - The following steps are under gone internally,  MAC Address is divided into two parts  FF-FE value is appended between the two parts  Interface Identifier is found by complementing 7th bit of firs byte  IPV6 Network Id (IPV6 prefix) and Interface Identifier are combined to produce IPV6 address  Once the sample experiment is done, then Refresh button can be clicked to create New Samples.
  • 84. 16. IPV6 Host Addresses Programming Guidelines This section guides the user to link his/her own code for IPV6 Host Addresses to NetSim. Pre - Conditions The user program should read the inputted scenario from text file named „Input‟ with extension txt. The user program after executing the concept should write the required output to a file named „Output’ with extension txt. Note:The temporary directory is navigated through the following step. Run Type "%temp%"  NetSim  "Input.txt" and "Output.txt" (Note : To open Run Press Windows+R) General Program Flow The program begins with the Reading of the Inputs from the input file Input.txt. Executing the required concept and, The results of the program should be written into the output file Output.txt. File Format Input File Format Output File Format IPV6_Address=1111:2222: 3333:4444:AAAA:BBBB: CCCC:DDDD Prefix_Length=12 The Output File format IPV6 Address> Binary value of IPV6 Address> Prefix part of IPV6 Address>Suffix part of IPV6 Address> Prefix part of Starting Address>Suffix part of Starting Address> Starting Address in hexa decimal notation> Prefix part of Ending Address>Suffix part of Ending Address> Ending Address in hexa decimal notation> Sample Output text Format 1111:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>
  • 85. 000100010001000100100010001000100011001100110011 010001000100010010101010101010101011101110111011 11001100110011001101110111011101>12>116> 000100010001>00010010001000100010001100110011001 101000100010001001010101010101010101110111011101 111001100110011001101110111011101> 000100010001>00000000000000000000000000000000000 000000000000000000000000000000000000000000000000 000000000000000000000000000000000> 1110:0000:0000:0000:0000:0000:0000:0000> 000100010001>11111111111111111111111111111111111 111111111111111111111111111111111111111111111111 111111111111111111111111111111111> 111F:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF> Interface Source Code Interface source code written in C is given using this the user can write only the fnHostAddresses () function using the variables already declared. To view the interface source code, go to NetSim Installation path / src / Programming/ IPV6HostAddress.c To find NetSim‟s Installation path right click NetSim icon and select  Open file location in Windows 7  Open file location in Windows Vista  Properties  find target in Windows XP. Sample Scenarios: Objective - To understand the concept of IPV6 Host Addresses through programming. How to Proceed? - The objective can be executed in NetSim using the programming exercise available, under programming user has to select IPV6 Addressing IPV6 Host Addresses, Sample Inputs - In the Input panel the following steps need to be done,  SampleMode should be selected.  Enter the IPV6 Address.  Select the Prefix length.  Then Run button need to be clicked. Refresh button can be used if new Inputs have to be given.
  • 86. Output - The following steps are under gone internally,  IPV6 is separated into two parts: Network Id bits (prefix) and Host Id bits (suffix)  Starting address of the network is found by replacing each bits of suffix part with zero  Ending address of the network is found by replacing each bits of suffix part with one  Once the sample experiment is done, then Refresh button can be clicked to create New Samples.
  • 87. 17. IPV6 Subnetting Programming Guidelines This section guides the user to link his/her own code for IPV6 Subnetting to NetSim. Pre - Conditions The user program should read the inputted scenario from text file named „Input‟ with extension txt. The user program after executing the concept should write the required output to a file named „Output’ with extension txt. Note:The temporary directory is navigated through the following step. Run Type "%temp%"  NetSim  "Input.txt" and "Output.txt" (Note : To open Run Press Windows+R) General Program Flow The program begins with the Reading of the Inputs from the input file Input.txt. Executing the required concept and, The results of the program should be written into the output file Output.txt. File Format Input File Format Output File Format IPV6_Address=1111:2222:3 333:4444:AAAA:BBBB:CC CC:DDDD Prefix_Length=12 Number_of_Subnets=2 Number_of_Level=2 Subnets_in_Level1=2 Subnets_in_Level2=4 The Output File format Binary value of IPV6 Address> Prefix part of IPV6 Address>Suffix part of IPV6 Address> Number of subnets>number of subnet msk bit> Prefix part of IPV6 Address>Subnet Id part of IPV6 address>Suffix part of IPV6 Address> Prefix part of IPV6 Address>Subnet Id part of IPV6 address>Suffix part of IPV6 Address> Prefix part of Level 1 „s first subnet Address> Subnet Id part of Level 1 „s first subnet Address> Suffix part of Level 1 „s first subnet Address> Hexa decimal value of Level 1 „s first
  • 88. subnet address>prefix length of Level 1 „s first subnet> . . until number of subnet reached in the first level First level‟s subnet number>Prefix part of Level 2 „s first subnet Address> Subnet Id part of Level 2 „s first subnet Address> Suffix part of Level 2 „s first subnet Address> Hexa decimal value of Level 2 „s first subnet address>prefix length of Level 2 „s first subnet> . . until the number of subnets reached in the second level of first level‟s subnet . . until the number of subnets reached in the first level Sample Output text Format 1111:2222:3333:4444:AAAA:BBBB:CCCC:DDDD> 0001000100011001001000100010001000110011001100110 1000100010001001010101010101010101110111011101111 001100110011001101110111011101> 000100010001>000100100010001000100011001100110011 0100010001000100101010101010101010111011101110111 1001100110011001101110111011101>2>1> 000100010001>0>001001000100010001000110011001100 1101000100010001001010101010101010101110111011101 111001100110011001101110111011101> 000100010001>0>001001000100010001000110011001100 1101000100010001001010101010101010101110111011101 111001100110011001101110111011101>1111:2222:3333:4 444:AAAA:BBBB:CCCC:DDDD>13> 000100010001>1>001001000100010001000110011001100 1101000100010001001010101010101010101110111011101 111001100110011001101110111011101>1119:2222:3333:4 444:AAAA:BBBB:CCCC:DDDD>13> 0>1111:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>15> 0>1113:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>15> 0>1115:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>15> 0>1117:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>15> 1>1119:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>15> 1>111B:2222:3333:4444:AAAA:BBBB:CCCC:DDDD>15>