Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

NETWORK LAB VTU MANUAL FOR 7TH SEM COMPUTER SCIENCE STUDENTS, Study Guides, Projects, Research of Computer Networks

NETWORKS LAB MANUAL FOR VTU STUDENT 7TH SEM COMPUTER SCIENCE LAUDA LEHSUN

Typology: Study Guides, Projects, Research

2015/2016

Uploaded on 11/20/2016

Ashish.Singh
Ashish.Singh 🇮🇳

4.5

(2)

1 document

1 / 56

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
BANGALORE INSTITUTE OF TECHNOLOGY
Affiliated to Visvesvaraya Technological University
K.R.Road, V.V.Puram, Bangalore-560004
Department of
INFORMATION SCIENCE & ENGINEERING
CGI Programming Laboratory
2007-2008
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38

Partial preview of the text

Download NETWORK LAB VTU MANUAL FOR 7TH SEM COMPUTER SCIENCE STUDENTS and more Study Guides, Projects, Research Computer Networks in PDF only on Docsity!

BANGALORE INSTITUTE OF TECHNOLOGY

Affiliated to Visvesvaraya Technological University

K.R.Road, V.V.Puram, Bangalore-

Department of

INFORMATION SCIENCE & ENGINEERING

CGI Programming Laboratory

B S SANTOSH

Dept of ISE BIT, Bangalore 2007-

Prg.no. PROGRAM Page.no. PART A

1. Simulate a three nodes point - to - point networks with a duplex links between them .Set the queue size and vary the band width and find the number of packets dropped

2. 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 parameters and determine the number of packets send by TCP/UDP

3. Simulate the different types of Internet traffic such as FTP,TELNET over a network and analyze the throughput

4. Simulate the transmission of ping messages over a network topology consisting of 6 nodes and find the number of packets dropped due to congestion

5. Simulate an Ethernet LAN using N nodes (6 - 10) , change error rate and data rateand compare throughput

6. Simulate an Ethernet LAN using 'n' nodes and set multiple traffic nodes and determine collisions across different nodes

7. Simulate an Ethernet LAN using 'n' nodes and set multiple traffic nodes and plot congestion window for different source and destination

8. Simulate simple BSS and with transmitting nodes in wire-less LAN by simulation and determine the performance with respect to transmission of packets

PART B

1. Write a C/C++ program for error detecting code: CRC-CCITT and CRC- 16

2. Write a C/C++ program for frame sorting technique used in buffer^ 16 3. Write a C/C++ program for Distance Vector Algorithm to find suitable path for transmission

4. WRITE A C/C++ PROGRAM FOR SPANNING TREE ALGORITHM

TO FIND LOOPLESS PATH WITH 6 TO 10 NODES

5. Using TCP/IP sockets, write a client-server program to make client sending the file name and the server to send back the content of the requested file if present 6. Implement the above program using message queues or FIFO as IPC channels 7. Write a program for simple RSA algorithm to encrypt and decrypt the data key generation algorithm RSA 8A. Write a program to generate the HAMMING CODE for the given data 8B. Write a program^ Detection and Correction OF errors in HAMMING CODE 9. Write a C/C++ program for congestion control using Leaky Bucket Algorithm

INDEX

In Networks Laboratory we have 2 parts of exercises ,

1. Simulation

For this we use software called NCTUns. It provides us the

provision of simulating network between computers and to

analyze how network communication is carried, it also provides

the provision to analyze various network parameters like

collision, dropped packets, throughput.

2. C/C++ programming

Here we implement basic algorithms that are used extensively

used in network communication like, Spanning tree algorithm,

Distance vector algorithm, Hamming, RSA encryption

algorithm.

Hardware and Software Requirements

Hardware Requirements

  • Processor : Pentium 3 or higher
  • RAM : 512MB or more
  • Hard Disk : 16GB or more( there should be enough space to

hold both Linux and Windows)

Software Requirements

  • Operating System : Windows, Linux
  • Compiler: Turbo C\C++ or Borland C\C++
  • Simulation Software: NCTUns

To work with NCTUns,

  • Restart the computer and login to NCTUns kernel
  • Create a user as we cannot work as root in NCTUns
  • Login as new user
  • To use NCTUns user should have root user privileges, become

root user by using command “su”

  • Run dispatcher “/usr/local/nctuns/bin/dispatcher”
  • Run coordinator “/usr/local/nctuns/bin/coordinator”
  • Run nctuns client “/usr/local/nctuns/bin/nctunsclient”
  • Draw the topology in draw mode
  • Save it, and edit the parameters
  • Run the simulation
  • Results of simulation are available in results folder created in

user’s directory. Users can open those log files and see what

happened in the scenario. Nctuns also provision of drawing

graphs, with this facility users can analyze graphs of network

parameters like various throughputs, congestion.

PART-A (Simulation)

  1. Simulate a three nodes point - to - point networks with a duplex links between them .Set the queue size and vary the band width and find the number of packets dropped Using a HUB: Commands Used: stg -u 1024 40 1.0.1.2 (At the sender’s end) rtg -u -w log1 (At the receiver’s end) Queue size (fixed) 50 Bandwidth at sender’s end 10 Mbps , at receiver’s end 10 Mbps Sender’s throughput = 1179 Receiver’s throughput = 1179

Bandwidth at Sender’s end 10 Mbps , at Receiver’s end 10 Mbps Sender’s throughput = 1190 Receiver’s throughput = 1190 Collision and drop ~ Bandwidth at Sender’s end 10Mbps , at the receiver’s end 8Mbps Sender’s throughput = 585- Receiver’s throughput = 530- Collision and Drop = ~

  1. 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 parameters and determine the number of packets send by TCP/UDP. Commands used: stg -u 1400 40 1.0.1.3 (At the UDP sender) rtg -u -w log1 (At the receiver) rtcp -p 7000 -l 1024 (At the receiver) stcp -p 7000 -l 1024 (At the TCP sender) Bandwidth of the network 1000Mbps. Average no of TCP packets transferred = varying Average no of UDP packets transferred = 14416

Telnet: Commands Used: stcp -p 23 –l 1024 1.0.1.6 (At the sender’s end) rtcp -p 23 -l 1024 (At the receiver’s end) Sender’s throughput = 605- Receiver’s throughput = 605-

  1. Simulate the transmission of ping messages over a network topology consisting of 6 nodes and find the number of packets dropped due to congestion. Commands Used Create UDP connection from all 5 nodes to the receiver. Ping the receiver from other nodes , then terminate and check the ping statistics.
  1. Simulate an Ethernet LAN using 'n' nodes and set multiple traffic nodes and determine collisions across different nodes.

Commands Used: stcp -p 7000 -l 1024 1.0.1.4 (At sender no 1) stcp -p 7001 -l 1024 1.0. 5 (At sender no 2) rtcp -p 7000 –l 1024 (At receiver no 1) rtcp -p 7001 -l 1024 (At receiver no 2) Drops at Receiver no 1 = 580- Drops at Receiver no 2 = 580-

  1. Simulate simple BSS and with transmitting nodes in wire-less LAN by simulation and determine the performance with respect to transmission of packets Commands Used: Use a different subnet for the mobile hosts say 1.0.2. Use 1.0.2.1 as the gateway for the mobile network. Use 1.0.2.2 as the IP address for mobile node 1 Use 1.0.2.3 as the IP address for mobile node 2 ttcp -t –u –s –p 8000 1.0.1.1 (At mobile node 1) ttcp -t –u –s –p 8001 1.0.1.1 (At mobile node 2) ttcp -r –u –s –p 8000 (At fixed node) ttcp -r –u –s –p 8001 (At fixed node) Receiver’s throughput = 660-

PART B

PROGRAM 1

Write a C/C++ program for error detecting code: CRC-CCITT and CRC- #include<stdio.h> #include<string.h> #include<stdlib.h> #include<conio.h> int main() { char rem[50],a[50],s[50],c,msg[50]; char gen[]="10001000000000101"; int i,genlen,t,j,flag=0,k,n; printf("\nGenerator polynomial is CRC-CCITT:%s",gen); genlen=strlen(gen); k=genlen-1; printf("\nEnter the message:"); n=0; while((c=getchar())!='\n') { msg[n]=c; n++; } msg[n]='\0'; for(i=0;i<n;i++) a[i]=msg[i]; for(i=0;i<k;i++) a[n+i]='0'; a[n+k]='\0'; printf("\nMessage polynomial appended with zero's:"); puts(a); for(i=0;i<n;i++) { if(a[i]=='1') { t=i;