CN Lab Manual For IS Dept.

PART A ? Simulation Exercises. The following experiments shall be ... Write a
program for congestion control using Leaky bucket algorithm. PART A Programs.

Part of the document


[pic] COMPUTER NETWORKS
LAB MANUAL
1 For 2 VII SEMESTER
Prepared by: Jayashree.R,
Asst.Professor, Dept. of ISE,
Priya.M,
Asst.Lecturer,
Students of 2003 Batch.
DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING
P.E.S. INSTITUTE OF TECHNOLOGY
100 FEET RING ROAD, BANASHANKARI III STAGE
BANGALORE-560085
Networks Laboratory
(COMMON TO CSE & ISE) Sub Code : CSL77 Note : Student is required to solve one problem from PART-A and one
problem from PART-B. Both the parts have equal weightage. PART A - Simulation Exercises The following experiments shall be conducted using either NS228/OPNET or
any other simulators. Simulate a three nodes point-to-point network with duplex links between
them. Set the queue size vary the bandwidth and find the number of packets
dropped.
Simulate a four node point-to-point network, and connect the links as
follows: n0-n2, n1-n2 and n2-n3. Apply TCP agent between n0-n3 and UDP n1-
n3. Apply relevant applications over TCP and UDP agents changing the
parameter and determine the number of packets by TCP/UDP.
Simulate the different types of Internet traffic such as FTP a TELNET over
a network and analyze the throughput.
Simulate the transmission of ping messaged over a network topology
consisting of 6 nodes and find the number of packets dropped due to
congestion.
Simulate an Ethernet LAN using N-nodes(6-10), change error rate and data
rate and compare the throughput.
Simulate an Ethernet LAN using N nodes and set multiple traffic nodes and
determine collision across different nodes.
Simulate an Ethernet LAN using N nodes and set multiple traffic nodes and
plot congestion window for different source/destination.
Simulate simple ESS and with transmitting nodes in wire-less LAN by
simulation and determine the performance with respect to transmission of
packets. PART B The following experiments shall be conducted using C/C++. Write a program for error detecting code using CRC-CCITT (16-bits).
Write a program for frame sorting technique used in buffers.
Write a program for distance vector algorithm to find suitable path for
transmission.
Write a program for spanning tree algorithm (Kruskal's/Prim's) to find loop
less path.
Using TCP/IP sockets, write a client-server program to make client sending
the file name and the server to send back the contents of the requested
file if present.
Implement the above program using as message queues or FIFOs as IPC
channels.
Write a program for simple RSA algorithm to encrypt and decrypt the data.
Write a program for Hamming Code generation for error detection and
correction.
Write a program for congestion control using Leaky bucket algorithm.
PART A Programs Simulate a three-node point-to-point network with a duplex link between
them. Set the queue size and vary the bandwidth and find the number of
packets dropped. Topology:-
[pic] Sender:-
stcp -p 2000 -l 1024 1.0.1.2 Receiver:-
rtcp -p 2000 -l 1024 Parameters:-
Drop Packets and Collision Packets. Simulate a four-node point-to-point network and connect the link as
follows: Apply a TCP agent between n0 to n3 and apply a UDP agent between
n1 and n3. Apply relevant applications over TCP and UDP agents changing the
parameters and determine the number of packets sent by two agents. Topology:-
[pic]
Sender:-
stcp -p 3000 -l 1024 1.0.1.3
stg -u 1024 1.0.1.3 Receiver:-
rtcp -p 3000 -l 1024
rtg -u 3000 Parameters:-
Throughput of incoming and outgoing Packets
Simulate the different types of Internet traffic such as FTP, TELNET over a
network and analyze the throughput. Topology:-
[pic]
Sender:-
For FTP
stcp -p 21 -l 1024 1.0.1.3
For Telnet
stcp -p 23 -l 1024 1.0.1.3 Receiver:-
For FTP
rtcp -p 21 -l 1024
For Telnet
rtcp -p 23 -l 1024 Parameters:-
Throughput of incoming and outgoing Packets Simulate the transmission of ping messages over a network topology
consisting of 6 nodes and find the number of packets dropped due to
congestion. Topology:-
[pic]
Sender:-
stcp -p 2000 -l 1024 1.0.1.4 Receiver:-
rtcp -p 2000 -l 1024 Command Console:-
Goto tools-> simulation time and change Simulation time to 100. During run
mode, double click host 2 and then click command console. And execute the
following command. ping 1.0.1.4 Parameters:-
Drop Packets and Collision Packets. Simulate an Ethernet LAN using N nodes (6-10), change error rate and data
rate and compare throughput. Topology:-
[pic]
Sender:-
stcp -p 2000 -l 1024 1.0.1.4 Receiver:-
rtcp -p 2000 -l 1024 Double click on receiver link and change BER to 0.000001, Run Again. Parameters:-
Throughput of outgoing Packets Simulate an Ethernet LAN using N nodes and set multiple traffic nodes and
determine collisions across different nodes. Topology:-
[pic] Sender:-
stcp -p 2000 -l 1024 1.0.1.4 Receiver:-
rtcp -p 2000 -l 1024 Parameters:-
Collision Packets and Drop Packets (Optional) Simulate an Ethernet LAN using N nodes and set multiple traffic nodes and
plot congestion window for different source/destination. Topology:-
[pic] Sender:-
stcp -p 2000 -l 1024 1.0.1.4 Receiver:-
rtcp -p 2000 -l 1024 Parameters:-
Receiver side Collision Packets and Drop Packets Simulate simple BSS and with transmitting nodes in wireless LAN by
simulation and determine the performance with respect to transmission of
packets. Topology:-
[pic]
Click on "access point". Goto wireless interface and tick on "show
transmission range and then click OK. Double click on Router -> Node Editor and then
Left stack -> throughput of Incoming packets
Right stack -> throughput of Outgoing packets Select mobile hosts and access points then click on.
Tools -> WLAN mobile nodes-> WLAN Generate infrastructure.
Subnet ID: Port number of router (2)
Gateway ID: IP address of router Mobile Host 1
ttcp -t -u -s -p 3000 1.0.1.1 Mobile Host 1
ttcp -t -u -s -p 3001 1.0.1.1 Host(Receiver)
ttcp -r -u -s -p 3000
ttcp -r -u -s -p 3001 Run and then play to plot the graph.
Part B Programs Experiment No 1
CRC Problem Statement
Write a program for error detecting code using CRC-CCITT (16-bits). Theory
It does error checking via polynomial division. In general, a bit string bn-1bn-2bn-3...b2b1b0 As bn-1Xn-1 + bn-2 Xn-2 + bn-3 Xn-3 + ...b2 X2 + b1 X1 + b0
Ex: -
10010101110 As X10 + X7 + X5 + X3 + X2 + X1 All computations are done in modulo 2 Algorithm:-
Given a bit string, append 0S to the end of it (the number of 0s is the
same as the degree of the generator polynomial) let B(x) be the polynomial
corresponding to B.
Divide B(x) by some agreed on polynomial G(x) (generator polynomial) and
determine the remainder R(x). This division is to be done using Modulo 2
Division.
Define T(x) = B(x) -R(x) (T(x)/G(x) => remainder 0) Transmit T, the bit string corresponding to T(x).
Let T' represent the bit stream the receiver gets and T'(x) the associated
polynomial. The receiver divides T1(x) by G(x). If there is a 0 remainder,
the receiver concludes T = T' and no error occurred otherwise, the receiver
concludes an error occurred and requires a retransmission. Program #include
#include
#include
#define N strlen(g) char t[128], cs[128], g[]="10001000000100001";
int a, e, c; void xor() {
for(c=1;c