Вы находитесь на странице: 1из 158

LABORATORY MANUAL

EC6611 – COMPUTER NETWORKS LABORATORY


VI SEM ECE

DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERIGN

PREPARED BY
V.RAJESH - Assistant Professor / ECE
N.DARWIN – Assistant professor II / ECE

PRATHYUSHA
INSTITUTE OF TECHNOLOGY AND MANAGEMENT
ARANVAYALKUPPAM
TIRUVALLUR – 602 025
EC6611 - COMPUTER NEWORKS LABORATORY

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

PRATHYUSHA INSTITUTE OF TECHNOLOGY AND MANAGEMENT


ARANVOYALKUPPAM, THIRUVALLUR-602 025

VISION

To emerge as a premier Technical, engineering and management in the country by imparting


quality education and thus facilitate our students to blossom into dynamic professionals so that
they play a vital role for the progress of the nation and for a peaceful co-existence of our
human beings.

MISSION

Prathyusha Institute of Technology and Management will strive to emerge as a


premier Institution in the country by
 Providing State-of-the-art infrastructure facilities
 Imparting Quality education and training through qualified, experienced and committed
members of the faculty.
 Empowering the youth by providing professional leadership
 Developing centers of excellence in frontier areas of engineering/Technology and
management.
 Networking with Industry, corporate and research organizations.
 Promoting Institute –Industry partnership for the peace and prosperity of the nation.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

VISION

To promote academic growth by offering state of the art undergraduate and graduate
programmes, and to evolve as a Centre of Excellence in Electronics and Communication
Engineering equipped with highly skilled, trained and confident engineers imbued with
knowledge of core as well as interdisciplinary domains

MISSION

1. To produce competent engineers adequately prepared to face challenges of the society


also aims at providing adequate practical training in laboratory which meets the
requirement of the Electronics and Communication Engineering
2. To develop innovative and simple instructional material for theoretical and practical
subjects to drive the concepts into the minds of the students and guide them towards the
success in Electronics and Communication Engineering
3. To develop the department into a full fledged centre of learning in various fields of
Electronics and Communication Engineering keeping in view the latest developments
4. To develop overall personality of the students by encouraging them to participate in
technical activates, sports and personality development programmes.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


PROGRAMME EDUCATIONAL OBJECTIVES
 To include knowledge and an ability to identify, analyze and solve engineering problems
associated with their professional position independently and in team environment
through lifelong learning
 To enable the graduates to become dynamic professional in industries
 To enable the graduates to use the knowledge and communication skills acquired in their
graduate program for the development of the nation
PROGRAM OUTCOMES
a. An ability to apply knowledge of mathematics, science, Electronics and
Communication engineering
b. An ability to design and conduct experiments, as well as to analyze and interpret data.
c. An ability to design a system or a component, or process to meet desired needs within
realistic constraints such as economic, environmental and social and health
d. An ability to function on multidisciplinary teams.
e. An ability to identify, formulate and solve engineering problems
f. An ability to understand the professional and ethical responsibility
g. An ability to communicate effectively (ORAL / WRITTEN)
h. An ability to understand the necessary of broad education and impact of engineering
solutions in a global, economic, environment, and societal context
i. An ability to recognize the need and engage in life long learning
j. An abilty to use the knowledge of contemporary issues.
k. An ability to use the techniques, skills, and modern engineering tools, necessary for
engineering practices.
l. An Ability to develop project management skills and teamwork necessary for
successful system design and implementations.
m. An Ability to participate and succeed in competitive examination like GRE, GATE,
TOEFL, GMAT etc.
n. An Ability to design and develop electronics and communication systems using
modern tools.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

SYLLABUS
EC6611 – COMPUTER NETWORKS LABORATORY LTPC0032
OBJECTIVES:
The student should be made to:
Learn to communicate between two desktop computers.
Learn to implement the different protocols
Be familiar with socket programming.
Be familiar with the various routing algorithms
Be familiar with simulation tools.

LIST OF EXPERIMENTS:
1. Implementation of Error Detection / Error Correction Techniques
2. Implementation of Stop and Wait Protocol and sliding window
3. Implementation and study of Goback-N and selective repeat protocols
4. Implementation of High Level Data Link Control
5. Study of Socket Programming and Client – Server model
6. Write a socket Program for Echo/Ping/Talk commands.
7. To create scenario and study the performance of network with CSMA / CA
protocol and compare with CSMA/CD protocols.
8. Network Topology - Star, Bus, Ring
9. Implementation of distance vector routing algorithm
10. Implementation of Link state routing algorithm
11. Study of Network simulator (NS) and simulation of Congestion Control Algorithms using
NS
12. Encryption and decryption.

TOTAL: 45 PERIODS
OUTCOMES:
At the end of the course, the student should be able to
Communicate between two desktop computers.
Implement the different protocols
Program using sockets.
Implement and compare the various routing algorithms
Use simulation tool.

LIST OF EQUIPMENT FOR A BATCH OF 30 STUDENTS


SOFTWARE
C / C++ / Java / Equivalent Compiler
Network simulator like NS2/ NS3 / Glomosim/OPNET/
Equivalent - 30

HARDWARE
Standalone desktops - 30 Nos

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
CONTENTS

Exp. No Name of the Experiment Page No

1.1 Implementation of Stop & Wait Protocol 9


1
1.2 Implementation of Sliding Window Protocol 17

2.1 Implementation and Study of Go Back N Protocol 25


2
2.2 Implementation and Study of Selective Repeat Protocol 33

3.1 Implementation and Study of CSMA-CD Protocol 41


3
3.2 Implementation and Study of CSMA-CA Protocol 45

4.1 Network Topology – Star 49


4 4.2 Network Topology – Bus 55
4.3 Network Topology – Ring 59
5 Implementation of Distance Vector Routing Algorithm 63
6 Implementation of Link State Vector Routing Algorithm 69
7.1 Study of Socket Programming 75
7 7.2 TCP Two way communication. 83
7.3 Implementation of FTP 89
8.1 Socket Program for Echo commands 95
8 8.2 Socket Program for Ping commands 101
8.3 Socket Program for Talk commands 107
9 Implementation of Error Detection / Error Correction Techniques 111

10.1 Encryption and Decryption 117


10
10.2 Encryption and Decryption using C 123

11.1 Study of Network Simulator (NS) 127


11
11.2 Congestion control algorithms using TCP & UDP 133

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
ADDITIONAL EXPERIMENTS

12 PC-PC Communication using Parallel communication 139

Connecting a College Campus through wireless LAN using


13 145
OPNET

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO: 1. 1. IMPLEMENTATION OF STOP & WAIT PROTOCOL

OBJECTIVE:
To study Stop & Wait protocol

EQUIPMENTS:
• DCT-03 & LTS-01 trainer kit.
• 25 Pin D connector Cables – 2 Nos.
• 2 Computers with win-2K / XP and LAN card installed on them.
• Connecting Chords.
• RJ-45 to RJ-45 LAN connecting cables.
• Power Supply.

PROCEDURE:

USING DCT-03:
1. Carry out the following connections and settings as shown in the diagram.
2. Keep all switch fault switches in off position.
3. Keep switch SW6 in PC mode.
4. Connect LPT/parallel port of one PC to connector CN1 on left hand side on DCT-03 kit using
25-25 pin D type cable. Similarly connect LPT/parallel port of another PC to connector CN2 on
right hand side on DCT-03 kit using 25-25 pin D type cable.
5. Keep the switch settings for SW1, SW2 & SW3 in ON position as shown.
6. Switch ON the power supply.
7. Run DCT software and select Parallel Communication Software link on both PC’s.
8. Click on Port Setting will show you three ports (i.e. LPT1, LPT2, LPT3), select the port from
the user machine through which the data transfer has to occur. For example Clicking on LPT1
will set the LPT1 as the active port on the machine for the data transfer.

10

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
9. Please ensure that the selected ports are in bi-directional mode, this can be checked from the
BIOS settings of the computer.

11

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

10. Clicking on Protocols will show you three protocols namely Stop and Wait Protocol, Go
Back N Protocol and Selective Repeat protocol. Select Stop and Wait protocol on both PC.
11. Select one PC in transmit mode and another PC in receive mode.
12. Select the file to be sent from the transmitter computer, the screen shown below will appear
at transmitter side, with details of file selected number of packets formed using 128 byte per
packet size.
13. Inter packet delay can be varied from 5 ms to 100 ms.
14. Packets to be sent are shown with blue colour.
15. Click on Transmit file button.
16. On the remote PC click on receive file button.
17. Status of file transfer will be indicated on screen with different colour coding depending on
the status of packet whether it is sent & acknowledged, sent but not acknowledged, bad packet
error in packet.
18. After the user has selected the file. The PC shows the No of Packets and Size of the file in
the boxes on the top. The Packets with their packet sequence is also shown.
19. Once the transfer starts and the client computer acknowledges the packets it sends the signal
back to the transmitting PC. Any acknowledge positive or negative with their packet sequence is
displayed below the Current Packet No.
20. Any positive acknowledge received is displayed as ACK(0) and any negative acknowledge is
displayed as NACK(0) along with their packet sequence in brackets.
21. Once the packet has been acknowledged and signal shown the next packet is transmitted and
so on till the whole file gets transmitted.
22. On the right hand top shows frame info. The frame info consists of different color packets.
Each color specifies different status of the packet.
23. Observe the effect on file transfer by introducing error in data bits use switch SW2 to
introduce error for a moment.
24. Once the file transfer gets complete you will be prompted by file transfer successful at
transmitter.

12

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
25. At the receiver a selection window will popup to indicate location for the received file to be
saved.

13

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

26. Verify the received file with transmitted file, this shows end of file transfer with success.
27. The receiving packets can be discarded or killed by clicking the Discard button.
28. Any acknowledge that is transmitted back can be also made to lost by just clicking Lost
button. Thus the Transmitter side will not receive any acknowledge.
29. The third button NACK/LOST can be clicked to discard and to lose any acknowledge
sending back to the Transmitter simultaneously.

USING LTS-01:
1. Connect 2 computer LAN ports using RJ-45 to RJ-45 LAN connecting cables provided with
the system to LTS-01 star topology ports.
2. Switch on the LTS-01 & Computers.
3. Run L-SIM software on all the computers, one should be server and others should be clients.
4. On the server computer select type of network as LAN.
5. On the server computer select the topology as STAR, select protocol as Stop & Wait click on
create network button.
6. Remote computer details will appear on the computers connected in network, server will be
able to see all clients and all clients will be able to see only server.
7. Select the computer to whom data file is to be transferred, from the load button, previously
stored/selected file information can be loaded or you can select any file, which is to be
transmitted.
8. File size will appear in the software window, select the packet size, inter packet delay and
click OK.
9. Total packets formed for that file will be indicated on computers, same details of file will
appear on remote computer to which file is to be transmitted.
10. Click on file transfer button to transfer file.

14

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

15

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

11. During file transfer process you can insert errors into data packets being transmitted through
software window.
12. See the effect of Bad packet error, Packet negative acknowledgment error or auto errors on
file transfer.
13. File transfer from one computer to another will take place.
14. Multiple file transfer between various server-client combinations should be performed to
observe throughput v/s packet size graph on transmitter computer.

VIVA QUESTIONS:
1. How does a single bit error differ from a burst error?
2. Define Protocol.
3. Give the features of Stop & Wait Protocol.
4. What is the use of Physical addressing and Logical addressing in OSI?
5. What is Error Detection?

OBSERVATION:
Thus the stop and wait protocol is implemented using DCT Trainer / LAN Trainer and studied
their performance by introducing error while transferring packets.

16

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

17

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 1. 2. IMPLEMENTATION OF SLIDING WINDOW PROTOCOL

OBJECTIVE:
To write a program Sliding window protocol using C and Java.
ALGORITHM:
SERVER:

1. Start the program. Import .net and other necessary packages.


2. Declare objects for input/output and Socket to receive the frame and
send acknowledgement.
3. Wait for the client to establish connection.
4. Receive the frame one by one from the socket and return the frame number
as acknowledgement within the thread sleep time.
5. Send acknowledgement for each receiving frame and continue the process
until acknowledgement for all frames are sent.
6. When acknowledgement the last frame, exit the program.

CLIENT:

1. Start the program.


2. Import .net and other necessary packages.
3. Create objects for Serversocket,socket to send the frames.
4. Display the server address when the server is connected.
5. Get the number of frames to be sent, from the user.
6. Send the first frame to server using the socket.
7. When one frame is sent, wait for the acknowledgement from the receiver for the
previous frame.
8. Make use of Thread.Sleepa()method to pause the sending of frame until
acknowledgement is received.
9. When the acknowledgement is received, send the next frame.
10. Continue the process till all specified number of frames are sent and
acknowledgement is received.
11. When all the frames are sent and acknowledgement is received exit the program.

//SENDER PROGRAM

import java.net.*;
import java.io.*;
import java.rmi.*;
public class slidsender

{
public static void main(String a[])throws Exception
18

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

{
ServerSocket ser=new ServerSocket(10);

Socket s=ser.accept();
DataInputStream in=new DataInputStream(System.in);

DataInputStream in1=new DataInputStream(s.getInputStream());


String sbuff[]=new String[8];
PrintStream p;
int sptr=0,sws=8,nf,ano,i;
String ch;
do
{
p=new PrintStream(s.getOutputStream());
System.out.print("Enter the no. of frames : ");
nf=Integer.parseInt(in.readLine());
p.println(nf);
if(nf<=sws-1)
{

System.out.println("Enter "+nf+" Messages to be send\n");


for(i=1;i<=nf;i++)
{
sbuff[sptr]=in.readLine();
p.println(sbuff[sptr]);
sptr=++sptr%8;
}
sws-=nf;
System.out.print("Acknowledgment received");
ano=Integer.parseInt(in1.readLine());
System.out.println(" for "+ano+" frames");
sws+=nf;
}
else
{
System.out.println("The no. of frames exceeds window size");
break;
}
System.out.print("\nDo you wants to send some more frames : ");
ch=in.readLine(); p.println(ch);
}
while(ch.equals("yes"));
s.close();
}
}

19

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

//RECEIVER PROGRAM

import java.net.*;
import java.io.*;
class slidreceiver
{
public static void main(String a[])throws Exception

{
Socket s=new Socket(InetAddress.getLocalHost(),10);
DataInputStream in=new DataInputStream(s.getInputStream());
PrintStream p=new PrintStream(s.getOutputStream());
int i=0,rptr=-1,nf,rws=8;
String rbuf[]=new String[8];
String ch; System.out.println();
do
{
nf=Integer.parseInt(in.readLine());
if(nf<=rws-1)
{
for(i=1;i<=nf;i++)
{
rptr=++rptr%8;
rbuf[rptr]=in.readLine();
System.out.println("The received Frame " +rptr+" is : "+rbuf[rptr]);
}
rws-=nf;
System.out.println("\nAcknowledgment sent\n");
p.println(rptr+1); rws+=nf; }
else
break;
ch=in.readLine();
}
while(ch.equals("yes"));
}
}

20

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

OUTPUT:
//SENDER OUTPUT
Enter the no. of frames: 4
Enter 4 Messages to be send
hi
how r u
i am fine
how is everyone
Acknowledgment received for 4 frames

Do you wants to send some more frames : no

//RECEIVER OUTPUT
The received Frame 0 is : hi
The received Frame 1 is : how r u
The received Frame 2 is : i am fine
The received Frame 3 is : how is everyone

SLIDING WINDOW USING C LINUX MINT


SENDER
#include<sys/socket.h>
#include<sys/types.h>
#include<netinet/in.h>
#include<netdb.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<unistd.h>
#include<errno.h>
int main()
{
intsock,bytes_received,connected,true=1,i=1,s,f=0,sin_size;
charsend_data[1024],data[1024],c,fr[30]=" ";
structsockaddr_inserver_addr,client_addr;
if((sock=socket(AF_INET,SOCK_STREAM,0))==-1)
{
perror("Socket not created");
exit(1);
}
if(setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,&true,sizeof(int))==-1)
{
perror("Setsockopt");
exit(1);
21

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
}
server_addr.sin_family=AF_INET;
server_addr.sin_port=htons(17000);
server_addr.sin_addr.s_addr=INADDR_ANY;
if(bind(sock,(structsockaddr *)&server_addr,sizeof(structsockaddr))==-1)
{
perror("Unable to bind");
exit(1);
}
if(listen(sock,5)==-1)
{
perror("Listen");
exit(1);
}
fflush(stdout);
sin_size=sizeof(structsockaddr_in);
connected=accept(sock,(structsockaddr *)&client_addr,&sin_size);
while(strcmp(fr,"exit")!=0)
{
printf("Enter Data Frame %d:(Enter exit for End): ",i);
scanf("%s",fr);
send(connected,fr,strlen(fr),0);
recv(sock,data,1024,0);
if(strlen(data)!=0)
printf("I got an acknowledgement : %s\n",data);
fflush(stdout);
i++;
}
close(sock);
return (0);
}

RECEIVER
#include<sys/socket.h>
#include<sys/types.h>
#include<netinet/in.h>
#include<netdb.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<unistd.h>
#include<errno.h>
int main()
{
intsock,bytes_received,i=1;
char receive[30];
structhostent *host;
22

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
structsockaddr_inserver_addr;
host=gethostbyname("127.0.0.1");
if((sock=socket(AF_INET,SOCK_STREAM,0))==-1)
{
perror("Socket not created");
exit(1);
}
printf("Socket created");
server_addr.sin_family=AF_INET;
server_addr.sin_port=htons(17000);
server_addr.sin_addr=*((structin_addr *)host->h_addr);
bzero(&(server_addr.sin_zero),8);
if(connect(sock,(structsockaddr *)&server_addr,sizeof(structsockaddr))==-1)
{
perror("Connect");
exit(1);
}
while(1)
{
bytes_received=recv(sock,receive,20,0);
receive[bytes_received]='\0';
if(strcmp(receive,"exit")==0||strcmp(receive,"exit")==0)
{
close(sock);
break;
}
else
{
if(strlen(receive)<10)
{
printf("\n Frame %d data %s received\n",i,receive);
send(0,receive,strlen(receive),0);
}
else
{
send(0,"negative",10,0);
}
i++;
}
}
close(sock);
return(0);
}

23

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

OUTPUT
SENDER
$ cc sender.c
$ ./a.out
Enter Data Frame 1:(Enter exit for End): Manoj
Enter Data Frame 2:(Enter exit for End): mca
Enter Data Frame 3:(Enter exit for End): exit
$

RECEIVER
$ cc receiver.c
$ ./a.out
Socket created
Frame 1 data Manoj received
Frame 2 data mca received
$

24

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

25

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 2.1 - IMPLEMENTATION AND STUDY OF GO BACK N PROTOCOL

OBJECTIVE:
To study Go Back N protocol

EQUIPMENTS:
• DCT-03 & LTS-01 trainer kit.
• 25 Pin D connector Cables – 2 Nos.
• 2 Computers with win-2K / XP and LAN card installed on them.
• Connecting Chords.
• RJ-45 to RJ-45 LAN connecting cables.
• Power Supply.

PROCEDURE:

USING DCT-03:
1. Carry out the following connections and settings as shown in the diagram.
2. Keep all switch fault switches in off position.
3. Keep switch SW6 in PC mode.
4. Connect LPT/parallel port of one PC to connector CN1 on left hand side on DCT-03 kit using
25-25 pin D type cable. Similarly connect LPT/parallel port of another PC to connector CN2 on
right hand side on DCT-03 kit using 25-25 pin D type cable.
5. Keep the switch settings for SW1, SW2 & SW3 in ON position as shown.
6. Switch ON the power supply.
7. Run DCT software and select Parallel Communication Software link on both PC’s.
8. Clicking on Port Setting will show you three ports (i.e. LPT1, LPT2, LPT3), select the port
from the user machine through which the data transfer has to occur. For example Clicking on
LPT1 will set the LPT1 as the active port on the machine for the data transfer.
9. Please ensure that the selected ports are in bi-directional mode, this can be checked from the
BIOS settings of the computer.

26

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

27

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

10. Clicking on Protocols will show you three protocols namely Stop and Wait Protocol, Go
Back N Protocol and Selective Repeat protocol. Select Go Back N protocol on both PC.
11. Select one PC in transmit mode and another PC in receive mode.
12. Select the file to be sent from the transmitter computer, the screen shown below will appear
at transmitter side, with details of file selected number of packets formed using 128 byte per
packet size.
13. Inter packet delay can be varied from 5 ms to 100 ms.
14. Window size can be selected from 3, 5, 7.
15. Packets to be sent are shown with blue colour.
16. Click on Transmit file button.
17. On the remote PC click on receive file button.
18. Status of file transfer will be indicated on screen with different colour coding depending on
the status of packet whether it is sent & acknowledged, sent but not acknowledged, bad packet
error in packet.
19. After the user has selected the file. The PC shows the No of Packets and Size of the file in
the boxes on the top. The Packets with their packet sequence is also shown.
20. Once the transfer starts and the client computer acknowledges the packets it sends the signal
back to the transmitting PC. Any acknowledge positive or negative with their packet sequence is
displayed below the Current Packet No.
21. Any positive acknowledge received is displayed as ACK(0) and any negative acknowledge is
displayed as NACK(0) along with their packet sequence in brackets.
22. Once the packet has been acknowledged and signal shown the next packet is transmitted and
so on till the whole file gets transmitted.
23. On the right hand top shows frame info. The frame info consists of different color packets.
Each color specifies different status of the packet.
24. Observe the effect on file transfer by introducing error in data bits use switch SW2 to
introduce error for a moment.
25. Once the file transfer gets complete you will be prompted by file transfer successful at
transmitter.

28

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

29

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

26. At the receiver a selection window will popup to indicate location for the received file to be
saved.
27. Verify the received file with transmitted file, this shows end of file transfer with success.
28. The receiving packets can be discarded or killed by clicking the Discard button.
29. Any acknowledge that is transmitted back can be also made to lost by just clicking Lost
button. Thus the Transmitter side will not receive any acknowledge.
30. The third button NACK/LOST can be clicked to discard and to lose any acknowledge
sending back to the Transmitter simultaneously.

USING LTS-01:
1. Connect 3 or more computer LAN ports using RJ-45 to RJ-45 LAN connecting cables
provided with the system to LTS-01 star topology ports.
2. Switch on the LTS-01 & Computers.
3. Run L-SIM software on all the computers, one should be server and others should be clients.
4. On the server computer select type of network as LAN.
5. On the server computer select the topology as STAR, select protocol as Go Back N click on
create network button.

6. Remote computer details will appear on the computers connected in network, server will be
able to see all clients and all clients will be able to see only server.
7. Select the computer to whom data file is to be transferred, from the load button, previously
stored/selected file information can be loaded or you can select any file, which is to be
transmitted.
8. File size will appear in the software window, select the packet size, inter packet delay, window
size and click OK.
9. Total packets formed for that file will be indicated on computers, same details of file will
appear on remote computer to which file is to be transmitted.
10. Click on file transfer button to transfer file.
11. During file transfer process you can insert errors into data packets being transmitted through
software window.

30

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

31

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

12. See the effect of Bad packet error, Packet negative acknowledgment error or auto errors on
file transfer; observe carefully which packet/packets are transmitted.
13. File transfer from one computer to another will take place.
14. Multiple file transfer between various server-client combinations should be performed to
observe throughput v/s packet size graph on transmitter computer.

VIVA QUESTIONS:
1. Define Topology.
2. What are the protocols used in noisy channels?.
3. List the types of Topologies.
4. Compare Mesh & Bus Topology.
5. Give the features of Go Back – N Protocol

OBSERVATION:
Thus the Go Back - N protocol is implemented using DCT Trainer / LAN Trainer and studied
their performance by introducing error while transferring packets.

32

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

33

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 2.2 - IMPLEMENTATION AND STUDY OF SELECTIVE REPEAT


PROTOCOL

OBJECTIVE:
To study Selective Repeat protocol

EQUIPMENTS:
• DCT-03 & LTS-01 trainer kit.
• 25 Pin D connector Cables – 2 Nos.
• 2 Computers with win-2K / XP and LAN card installed on them.
• Connecting Chords.
• RJ-45 to RJ-45 LAN connecting cables.
• Power Supply.

PROCEDURE:
USING DCT-03:
1. Carry out the following connections and settings as shown in the diagram.
2. Keep all switch fault switches in off position.
3. Keep switch SW6 in PC mode.
4. Connect LPT/parallel port of one PC to connector CN1 on left hand side on DCT-03 kit using
25-25 pin D type cable. Similarly connect LPT/parallel port of another PC to connector CN2 on
right hand side on DCT-03 kit using 25-25 pin D type cable.
5. Keep the switch settings for SW1, SW2 & SW3 in ON position as shown.
6. Switch ON the power supply.
7. Run DCT software and select Parallel Communication Software link on both PC’s.
8. Clicking on Port Setting will show you three ports (i.e. LPT1, LPT2, LPT3), select the port
from the user machine through which the data transfer has to occur. For example Clicking on
LPT1 will set the LPT1 as the active port on the machine for the data transfer.
9. Please ensure that the selected ports are in bi-directional mode, this can be checked from the
BIOS settings of the computer.

34

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

35

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

10. Clicking on Protocols will show you three protocols namely Stop and Wait Protocol, Go
Back N Protocol and Selective Repeat protocol. Select Selective Repeat protocol on both PC.
11. Select one PC in transmit mode and another PC in receive mode.
12. Select the file to be sent from the transmitter computer, the screen shown below will appear
at transmitter side, with details of file selected number of packets formed using 128 byte per
packet size.
13. Inter packet delay can be varied from 5 ms to 100 ms.
14. Window size can be selected from 3, 5, 7.
15. Packets to be sent are shown with blue colour.
16. Click on Transmit file button.
17. On the remote PC click on receive file button.
18. Status of file transfer will be indicated on screen with different colour coding depending on
the status of packet whether it is sent & acknowledged, sent but not acknowledged, bad packet
error in packet.
19. After the user has selected the file. The PC shows the No of Packets and Size of the file in
the boxes on the top. The Packets with their packet sequence is also shown.
20. Once the transfer starts and the client computer acknowledges the packets it sends the signal
back to the transmitting PC. Any acknowledge positive or negative with their packet sequence is
displayed below the Current Packet No.
21. Any positive acknowledge received is displayed as ACK(0) and any negative acknowledge is
displayed as NACK(0) along with their packet sequence in brackets.
22. Once the packet has been acknowledged and signal shown the next packet is transmitted and
so on till the whole file gets transmitted.
23. On the right hand top shows frame info. The frame info consists of different color packets.
Each color specifies different status of the packet.
24. Observe the effect on file transfer by introducing error in data bits use switch SW2 to
introduce error for a moment.
25. Once the file transfer gets complete you will be prompted by file transfer successful at
transmitter.

36

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

37

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
26. At the receiver a selection window will popup to indicate location for the received file to be
saved.
27. Verify the received file with transmitted file, this shows end of file transfer with success.
28. The receiving packets can be discarded or killed by clicking the Discard button.
29. Any acknowledge that is transmitted back can be also made to lost by just clicking Lost
button. Thus the Transmitter side will not receive any acknowledge.
30. The third button NACK/LOST can be clicked to discard and to lose any acknowledge
sending back to the Transmitter simultaneously.

USING LTS-01:
1. Connect 3 or more computer LAN ports using RJ-45 to RJ-45 LAN connecting cables
provided with the system to LTS-01 star topology ports.
2. Switch on the LTS-01 & Computers.
3. Run L-SIM software on all the computers, one should be server and others should be clients.
4. On the server computer select type of network as LAN.
5. On the server computer select the topology as STAR, select protocol as Selective Repeat click
on create network button.
6. Remote computer details will appear on the computers connected in network, server will be
able to see all clients and all clients will be able to see only server.
7. Select the computer to whom data file is to be transferred, from the load button, previously
stored/selected file information can be loaded or you can select any file, which is to be
transmitted.
8. File size will appear in the software window, select the packet size, inter packet delay, window
size and click OK.
9. Total packets formed for that file will be indicated on computers, same details of file will
appear on remote computer to which file is to be transmitted.
10. Click on file transfer button to transfer file.
11. During file transfer process you can insert errors into data packets being transmitted through
software window.
12. See the effect of Bad packet error, Packet negative acknowledgment error or auto errors on
file transfer; observe carefully which packet/packets are transmitted.

38

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

39

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

13. File transfer from one computer to another will take place.
14. Multiple file transfer between various server-client combinations should be performed to
observe throughput v/s packet size graph on transmitter computer.

VIVA QUESTIONS:

1. Explain Selective Repeat Protocol.


2. What is Hub?
3. What are Repeaters?
4. Name the types of Bridges.
5. What is meant by Flow control?
6. In what way sliding flow control is more efficient than stop & wait flow control?

OBSERVATION:
Thus the Selective Repeat protocol is implemented using DCT Trainer / LAN Trainer and
studied their performance by introducing error while transferring packets.

40

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

41

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 3.1 - IMPLEMENTATION AND STUDY OF CSMA-CD PROTOCOL

OBJECTIVE:
Implementation and study of CSMA-CD protocol.

EQUIPMENTS:
• LTS-01 trainer kit
• 3 Computers with win-2K / XP and LAN card installed on them
• RJ-45 to RJ-45 LAN connecting cables

PROCEDURE:
1. Connect 3 or more computer LAN ports using RJ-45 to RJ-45 LAN connecting cables
provided with the system to LTS-01 star topology ports.
2. Switch on the LTS-01 & Computers.
3. Run L-SIM software on all the computers, one should be server and others should be clients.
4. On the server computer select type of network as LAN.
5. On the server computer select the topology as STAR, select protocol as CSMA-CD click on
create network button.
6. Remote computer details will appear on the computers connected in network, server will be
able to see all clients and all clients will be able to see only server.
7. Select the server computer to whom data file is to be transferred from one of the client
computer; from the load button, previously stored/selected file information can be loaded or you
can select any file, which is to be transmitted.
8. File size will appear in the software window, select the packet size, inter packet delay and
click OK.
9. Total packets formed for that file will be indicated on computers, same details of file will
appear on remote computer to which file is to be transmitted.
10. Click on file transfer button to transfer file.
11. During file transfer process try to send file to server from another client computer, file
transfer from second transmitter will also gets initiated.

42

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

43

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

12. When packet from second sender collides with first sender it will be indicated as collision
packet. File from first sender will resume after some time and second sender file will be kept on
hold till first file transfer gets completed.

13. Once the first sender file reached to server it is prompted by transmission complete message.
14. Second sender file transfer will also get completed and thus collision of two packets
transmitted simultaneously from two senders is detected and cleared.

VIVA QUESTIONS:
1. Define CSMA/CD.
2. What is the advantage of Star Topology over Ring Topology?
3. What is the use of Hamming Codes?
4. What is Line Coding?
5. What are the features of FDDI?

OBSERVATION:
Thus the CSMA/CD protocol is implemented and studied their performance using L-
SIM.

44

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

45

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 3.2 - IMPLEMENTATION AND STUDY OF CSMA-CA PROTOCOL

OBJECTIVE:
Implementation and study of CSMA-CA protocol using LAN.

EQUIPMENTS:
• LTS-01 trainer kit
• 3 Computers with win-2K / XP and LAN card installed on them
• RJ-45 to RJ-45 LAN connecting cables
• Access point with accessories
• Wireless LAN Access cards with USB driver installed on respective computers

PROCEDURE:
1. Connect 3 or more computer LAN ports using RJ-45 to RJ-45 LAN connecting cables
provided with the system to LTS-01 star topology ports.
2. Switch on the LTS-01 & Computers.
3. Run L-SIM software on all the computers, one should be server and others should be clients.
4. On the server computer select type of network as LAN.
5. On the server computer select the topology as STAR, select protocol as CSMA-CA click on
create network button.
6. Remote computer details will appear on the computers connected in network, server will be
able to see all clients and all clients will be able to see only server.
7. Click on the Send RTS button to get your computer into transmitter mode.
8. Select the computer to whom data file is to be transferred, from the load button, previously
stored/selected file information can be loaded or you can select any file, which is to be
transmitted.
9. File size will appear in the software window, select the packet size, inter packet delay and
click OK.
10. Total packets formed for that file will be indicated on computers, same details of file will
appear on remote computer to which file is to be transmitted.

46

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

47

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

11. Click on file transfer button to transfer file.


12. During file transfer process try to get access to transmit file by clicking on Send RTS button,
you will be prompted with channel is busy message.
13. Thus collision of two packets transmitted simultaneously from two senders is avoided.
14. File transfer from one computer to another will take place.
15. Multiple file transfer between various server-client combinations should be performed to
observe throughput v/s packet size graph on transmitter computer.

VIVA QUESTIONS:

1. What is the enhancement of CSMA/CA over CSMA/CD?


2. What are the disadvantages of Star Topology?
3. What is the concept of Token Operation?
4. Define HDLC.
5. What is meant by Bit Stuffing?
6. What is multicast? What is the difference between uni-cast & multi-cast?
7. Explain Circuit Switching & Packet Switching.
8. Whether collisions occur in IEEE 802.5 LAN?

OBSERVATION:
Thus the CSMA/CA protocol is implemented and studied their performance using L-
SIM.

48

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

49

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 4 - NETWORK TOPOLOGY STAR, BUS, RING

OBJECTIVE: - To Study LAN using Star Topology.

APPRATUS REQUIRED: - Four to Five computers, cables

THEORY: -
LAN: When two or more computers are connected directly within the small well defined area
such as room, building etc. The physical topology of a network refers to the configuration of
cables, computers, and other peripherals.

Main Types of Network Topologies


In networking, the term "topology" refers to the layout of connected devices on a network.
Network topologies are categorized into the following basic types:
• Star Topology
• Ring Topology
• Bus Topology
• Tree Topology
• Mesh Topology
• Hybrid Topology
More complex networks can be built as hybrids of two or more of the above basic topologies.

Star Topology
Many home networks use the star topology. A star network features a central connection point
called a "hub" that may be a hub, switch or router. Devices typically connect to the hub with
Unshielded Twisted Pair (UTP) Ethernet.
Compared to the bus topology, a star network generally requires more cable, but a failure in any
star network cable will only take down one computer's network access and not the entire LAN.
(If the hub fails, however, the entire network also fails

50

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

DIAGRAM FOR STAR TOPOLOGY :.

51

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

PROCEDURE:-
1. Create folder of source name in both PC in C or D drive
2. Write text document in one PC (sender)
3. Open Star topology on both PC
4. Write destination IP address on both PC
5. Share folder
6. Open the folder
7. Save the parameters
8. Open the text document
9. Sent data
10. Received data on another PC

Advantages of a Star Topology


• Easy to install and wire.
• No disruptions to the network then connecting or removing devices.
• Easy to detect faults and to remove parts.
Disadvantages of a Star Topology
• Requires more cable length than a linear topology.
• If the hub or concentrator fails, nodes attached are disabled.
• More expensive than linear bus topologies because of the cost of the concentrators.
The protocols used with star configurations are usually Ethernet or Local Talk. Token Ring uses
a similar topology, called the star-wired ring.

VIVA QUESTIONS:

Q1. What are the different types of topology?


A1.Different types of topology are star, bus, ring, tree, mesh.

Q2. What are the advantages of star topology?


A2. Advantages are
• Easy to install and wire.
• No disruptions to the network then connecting or removing devices.
• Easy to detect faults and to remove parts.

52

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

53

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

Q3. What are the disadvantages of star topology?


A3.Disadvantages are:
• Requires more cable length than a linear topology
• More expensive than linear bus topologies because of the cost of the concentrators

Q4.What are the protocol used for the star topology?


A4. The protocols used with star configurations are usually Ethernet or Local Talk.

Q5.What type of transmission media is used in star topology?


A5.The transmission media used is twisted copper pair or optical fiber cable

Q6.Which topology can experience Contention and Collision?


A6. The topology which can experience Contention and Collision is Star topology.

Q7. Define the term Contention?


A7.When two or more station attempt to access a network at the same time.

Q8. What is a network?


A8.A network is a system of interconnected communication

Q9.Define Node?
A9. Entry or exit point of the network

Q10. Define protocols?


A10.Set of rules for the successful communication between two or more nodes in a network

RESULT: - Thus the Study of Star Topology using WLAN has been performed.

54

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

DIAGRAM FOR BUS TOPOLOGY :.

55

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 4.2 : - BUS TOPOLOGY

OBJECTIVE: - To Study LAN using Bus Topology.

APPRATUS REQUIRED: - Four to Five computers, cables

THEORY: --
LAN: When two or more computers are connected directly within the small well defined area
such as room, building etc. The physical topology of a network refers to the configuration of
cables, computers, and other peripherals.
Bus Topology:
A bus topology consists of a single cable connecting all nodes on a network without intervening
connectivity devices .The single cable is called a bus and can support one channel for
communication. Each node shares the bus’s total capacity
On bus topology network devices share the responsibility for getting the data from one point to
another. Ethernet bus topologies are relatively easy to install and don't require much cabling
compared to the alternatives. 10Base-2 ("ThinNet") and 10Base-5 ("ThickNet") both were
popular Ethernet cabling options many years ago for bus topologies. However, bus networks
work best with a limited number of devices. If more than a few dozen computers are added to a
network.

PROCEDURE:-

1. Create folder of destination node (ECE COM 1, ECE COM 2) name in both PC.
2. Click IPX protocol to enable it
3. Select server on one PC.
4. Select connect to network on another PC
5. Open the text document
6. Type the data on one PC
7. Sent data
8. Data is received on another PC

Advantages of a Linear Bus Topology


• Easy to connect a computer or peripheral to a linear bus.
• Requires less cable length than a star topology.

56

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

57

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

Disadvantages of a Linear Bus Topology


• Entire network shuts down if there is a break in the main cable.
• Terminators are required at both ends of the backbone cable.
• Difficult to identify the problem if the entire network shuts down.
Not meant to be used as a stand-alone solution in a large building

VIVA QUESTION :

Q1. Define topology?


A1.Physical composition of the network is defined as topology

Q2. What is poll?


A2. Primary message inquiring if secondary has any traffic to send

Q3. What does the term ―selection process‖ signify in bus topology?
A3. Primary message inquiring if secondary is ready to receive traffic

Q4.What are the advantage of bus topology?


A4. Easy to connect, requires less cable

Q5.What are the disadvantages of bus topology?


A5. Entire network shuts down if there is a break in the main cable

Q6.In which topology terminators are required?


A6.Bus Topology.

Q7. What is the central device in star topology??


A7.Hub/switch.

Q8. What are the different types of network?


A8.LAN.GAN, WAN, MAN

Q9.What does the term GAN stand for?


A9.Global area network

Q10.Define the term CAN?


A10.Campus area network

Result: - Data is transferred from one PC to another PC using BUS TOPOLOGY.

58

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

59

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 4.3 : - RING TOPOLOGY

OBJECTIVE: - To Study LAN using Token Ring Topology.

APPRATUS REQUIRED: - Four to Five computers, cables

PROCEDURE:

1. Connect four computer LAN ports using RJ-45 to RJ-45 LAN connecting cables provided
with the system to LTS-01 ring topology ports.
2. Switch on the LTS-01 & Computers.
3. Run L-SIM software on all the computers, one should be server and other 3 should be client.
Run the software in the sequence of connection i.e. server first followed by first client to last
client.
4. On the server computer select type of network as LAN.

5. On the server computer select the topology as RING, select protocol as Token Ring and select
token activation time as desired, click on create network button.
6. To just observe how token passes from one computer to another computer and effect of token
time keep token duration from 5 to 40 seconds and to do actual file transfer keep token duration
as 50 or 60 seconds.
7. Remote computer details will appear on the computers connected in network, server will be
able to see all clients and all clients will be able to see only server.
8. Select the computer to whom data file is to be transferred, from the load button, previously
stored/selected file information can be loaded or you can select any file, which is to be
transmitted.

60

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

61

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

9. File size will appear in the software window, select the packet size, inter packet delay and
click OK.
10. Total packets formed for that file will be indicated on computers, same details of file will
appear on remote computer to which file is to be transmitted.
11. Click on file transfer button to transfer file.
12. File transfer from one computer to another will take place.
13. To see the effect of ring break state remove any of the client from the hardware and close L-
SIM window for that client. Ring broken message will be prompted on server computer and
network will get destroyed, you need to reconfigure the network.

VIVA QUESTIONS:

1. What are the IEEE Standards for LAN Connection.

2. Define Token Bus.

3. Define Token Ring.

4. Explain the features of Ring Topology.

5. What is the use of Networking?

OBSERVATION:
Thus the performance of Token Bus and Token Ring protocols are studied by introducing error
in the network path

62

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

63

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 5 : - IMPLEMENTATION OF DISTANCE VECTOR ROUTING


ALGORITHM
OBJECTIVE:
Implementation of distance vector routing algorithm.

EQUIPMENTS:
• N-SIM
• Computer with win-2K / XP

PROCEDURE:
1. Run N-SIM software from your computer.
2. To check working of distance vector routing algorithm in the form of animated representation
click on distance vector routing under routing protocols.

64

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

3. You can study the working of distance vector routing algorithm through this animated movie.

4. To implement this algorithm click on algorithms under menu and click on distance vector
routing.

5. Add the number of routers you want to, select one by one, maximum 8 routers can be added,
all the added routers will appear in the window.

65

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

6. Click configure button to define the links between pair of routers and define its cost in
kilometers.
7. Once all the possible pairs have been defined click save button to save the configuration
defined by you.
8. Depending on the configuration you will see all the possible links defined by you are
implemented and drawn in the screen near the routers added.
9. You can edit the configuration at any time by clicking on the value of the router number or
cost.

66

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

10. To simulate and find out shortest path select the source and destination routers.

11. Click on simulate button to start the algorithm, this will calculate the shortest path and will
be shown on the screen.

67

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

12. Click on the result button to see the parameters for shortest path.

VIVA QUESTIONS:

1. What is the function of Router?


2. What is the need for Bridges?
3. Give the features of Distance Vector Routing Algorithm.
4. Give the basic principles for the algorithm operation.
5. What are Transparent Bridges?

OBSERVATION:

Thus the Distance vector routing algorithm is implemented using N-SIM and found the shortest
path between the routers

68

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

69

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 6 : - IMPLEMENTATION OF LINK STATE ROUTING ALGORITHM

OBJECTIVE:
Implementation of link state routing algorithm.

EQUIPMENTS:
• N-SIM
• Computer with win-2K / XP

PROCEDURE:
1. Run N-SIM software from your computer.
2. To check working of state routing algorithm in the form
representation click on state routing under routing protocols.

70

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

3. You can study the working of state routing algorithm through this animated movie.
4. To implement this algorithm click on algorithms under menu and click on state routing.

5. Add the number of routers you want to, select one by one, maximum 8 routers can be added,
all the added routers will appear in the window.

71

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

6. Click configure button to define the links between pair of routers and define its cost in
kilometers.
7. Once all the possible pairs have been defined click save button to save the configuration
defined by you.
8. Depending on the configuration you will see all the possible links defined by you are
implemented and drawn in the screen near the routers added.
9. You can edit the configuration at any time by clicking on the value of the router number or
cost.

9. To simulate and find out shortest path select the source and destination routers.

72

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

73

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

11. Click on simulate button to start the algorithm, this will calculate the shortest path and will
be shown on the screen.

12. Click on the result button to see the parameters for shortest path.
VIVA QUESTIONS:

1. What are the features of Link State Routing Algorithm?


2. What is the function of N-SIM in Routing Process?
3. What is Multiplexing?
4. What are the features of Packet Switching?
5. Differentiate Packet Switching & Circuit Switching.

OBSERVATION:
Thus the Link State vector routing algorithm is implemented using N-SIM and found the shortest
path between the routers

74

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

75

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 7 : - STUDY OF SOCKET PROGRAMMING

7.1: - SOCKETS:
1. Introduction

In the classic client-server model, the client sends out requests to the server, and the
server does some processing with the request(s) received, and returns a reply (or replies) to the
client. The terms request and reply here may take on different meanings depending upon the
context, and method of operation. An example of a simple and ubiquitous client-server
application would be that of a Web-server. A client (Internet Explorer, or Netscape) sends out a
request for a particular web page, and the web-server (which may be geographically distant,
often in a different continent!) receives and processes this request, and sends out a reply, which
in this case, is the web page that was requested. The web page is then displayed on the browser
(client).

Further, servers may be broadly classified into two types based on the way they serve
requests from clients. Iterative servers can serve only one client at a time. If two or more clients
send in their requests at the same time, one of them has to wait until the other client has received
service. On the other hand, concurrent servers can serve multiple clients at the same time.
Typically, this is done by spawning off a new server process on the receipt of a request – the
original process goes back to listening to new connections, and the newly spawned off process
serves the request received.

2. What are sockets?

Sockets (also called Berkeley Sockets, owing to their origin) can simply be defined as
end-points for communication. To provide a rather crude visualization, we could imagine the
client and server hosts in Figure 1 being connected by a pipe through which data-flow takes
place, and each end of the pipe can now be construed as an ―end-point‖. Thus, a socket provides
us with an abstraction – or a logical end point for communication. There are different types of
sockets. Stream sockets, of type SOCK_STREAM are used for connection oriented, TCP
connections, whereas datagram sockets of type SOCK_DGRAM are used for UDP based
applications. Apart from these two, there are other socket types defined, like SOCK_RAW and
SOCK_SEQPACKET.

76

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

77

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

2.1 Socket layer, and the Berkeley Socket API

Figure 2 shows the TCP/IP protocol stack, and shows where the ―Socket layer‖ may be placed.
Again, please be advised that this is just a representation to indicate the level at which we operate
when we write network programs using sockets. As shown in the figure, sockets make use of the
lower level network protocols, and provide the application developer with an interface to the
lower level network protocols. A library of system calls are provided by the socket layer, and are
termed as the ―Socket API‖. These system calls can be used in writing socket programs.

3 Basic Socket system calls


Figure 3 shows the sequence of system calls between a client and server for a connection
oriented protocol.

3.1 The socket() system call

The socket() system call creates a socket and returns a handle to the socket created. The
handle is of data type SOCKET. In UNIX based environments, the socket descriptor is a
non-negative integer, but Windows uses the SOCKET data type for the same.

socket() system call syntax

SOCKET sd = socket (int af, int type, int protocol);


Here, af is the Address family specification, type is the socket type and the protocol field
is used to specify the protocol to be used with the address family specified. The address
family can be one of AF_INET (for Internet protocols like TCP, UDP) or AF_UNIX (for
Unix internal protocols), AF_NS, for Xerox network protocols or AF_IMPLINK for the
IMP link layer. The type field is the socket type – which may be SOCK_STREAM for
stream sockets (TCP connections), or SOCK_DGRAM (for datagram connections).
Other socket types are defined too. SOCK_RAW is used for raw sockets, and
SOCK_SEQPACKET is used for a sequenced packet socket. The protocol argument is
typically set to 0. You may also specify a protocol argument to use a specific protocol
for your application.
socket system call
SOCKET sd = socket(...);
if (sd == INVALID_SOCKET) /* error condition */
{...}

3.2 The bind() system call

The bind() system call is used to specify the association <Local-Address—Local-Port>.


It is used to bind either connection oriented or connectionless sockets. The bind()
function basically associates a name to an unnamed socket. ―name‖, here refers to three

78

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

FIG 3. BASIC SOCKET CALLS FLOW DIAGRAM

79

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

components – The address family, the host address, and the port number at which the
application will provide its service. The syntax and arguments taken by the bind system
call is given below:
bind() syntax

int result = bind (SOCKET sd, const struct sockaddr* name, int namelen);
Here, sd is the SOCKET handle returned by the socket() system call before, and name
points to the SOCKADDR structure, and namelen is the length of the parameter name in
bytes.

bind system call

int res = bind (...);


if (res == SOCKET_ERROR) /* error condition */
{...}
Upon success, bind() returns 0. In case of error, bind()
returns SOCKET_ERROR. So the
return value of the bind system call must be checked against SOCKET_ERROR to check if
the call succeeded.

3.3 The listen() system call

After creation of the socket, and binding to a local port, the server has to wait on
incoming connection requests. The listen() system call is used to specify the queue or
backlog of waiting (or incomplete) connections. The syntax and arguments taken by the
listen system call is given below:
listen() syntax
int result = listen (SOCKET sd, int backlog);
Here, sd is the SOCKET handle returned by the socket() system call before, and backlog
is the number of incoming connections that can be queued.
listen system call
int result = listen (...);
if (result == SOCKET_ERROR) /* error condition */
{...}
Upon success, listen() returns 0. In case of error, listen() returns SOCKET_ERROR.

3.4 The accept() system call

After executing the listen() system call, a server waits for incoming connections. An
actual connection setup is completed by a call to accept(). accept() takes the first
connection request on the queue, and creates another socket with the same properties as
sd (the socket descriptor returned earlier by the socket() system call). In case of
blocking sockets, this call would block the caller until a connection request arrives.
accept() assumes a concurrent server, and automatically creates a new socket descriptor
for the connection request received. In case of concurrent servers, a new server process
is spawned (or ―fork‖ed in UNIX terminology), and the newly created server process
serves this connection on this socket. The earlier socket goes back to listening on new

80

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

connections. In a sense, the accept() system call completes the connection, and at the
end of a successful accept(), all elements of the four tuple (or the five tuple – if you
consider ―protocol‖ as one of the elements) of a connection are filled. The ―four-tuple‖
that we talk about here is <Local Addr, Local Port, Remote Addr, Remote Port>. This
combination of fields is used to uniquely identify a flow or a connection. The fifth tuple

element can be the protocol field. No two connections can have the same values for all
the four (or five) fields of the tuple.
accept() syntax
SOCKET newsd = accept (SOCKET sd, struct sockaddr* addr, int* addrlen);
Here, sd is the SOCKET handle returned by the socket() system call before, and addr is a
pointer to a buffer that receives the address of the connecting entity, and addrlen is the
length of the parameter addr.
accept system call
SOCKET newsd = accept (...);
if (newsd == INVALID_SOCKET) /* error condition */
{...}
Upon success, accept() returns a handle to the new socket created. In case of error,
accept() returns SOCKET_ERROR.

3.5 The connect() system call

A client process also starts out by creating a socket by calling the socket() system call. It
uses connect() to connect that socket descriptor to establish a connection with a server.
In the case of a connection oriented protocol (like TCP/IP), the connect() system call
results in the actual connection establishment of a connection between the two hosts. In
case of TCP, following this call, the three-way handshake to establish a connection is
completed. Note that the client does not have to bind to a local port in order to call
connect(). Clients typically choose ephemeral port numbers for their end of the
connection. Servers, on the other hand, have to provide service on well-known
(premeditated) port numbers.
connect() syntax
int result = connect (SOCKET sd, const struct sockaddr* servaddr, int addrlen);
Here, sd is the SOCKET handle returned by the socket() system call before, servaddr is a
pointer to the server’s address structure. addrlen holds the length of this parameter.
connect system call
int result = connect (...);
if (result == SOCKET_ERROR) /* error condition */
{...}
Upon success, connect() returns 0. In case of error, connect() returns SOCKET_ERROR.

3.6 send(), recv(), sendto() and recvfrom() system calls

After connection establishment, data is exchanged between the server and client using the
system calls send(), recv(), sendto() and recvfrom(). The syntax of the system calls are
as below:
send(), recv(), sendto() and recvfrom() syntax
int nbytes = send (SOCKET sd, const char* buf, int len, int flags);
81

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

int nbytes = recv (SOCKET sd, const char* buf, int len, int flags);
int nbytes = sendto (SOCKET sd, const char* buf, int len, int flags,
struct sockaddr* to, int tolen);
int nbytes = recvfrom (SOCKET sd, const char* buf, int len, int flags,
struct sockaddr* from, int fromlen);
Here, sd is the SOCKET handle returned by the socket() system call before, buf is the
char buffer to be sent or received, flags is the indicator specifying the way the call is to be
made. sendto() and recvfrom() are used in case of connectionless sockets, and they do
the same function as send() and recv() except that they take more arguments (the ―to‖
and ―from‖ addresses – as the socket is connectionless)
Upon success, all these calls return the number of bytes written or read. Upon failure, all
the above calls return SOCKET_ERROR

3.7 The closesocket() system call

The closesocket() system call is used to close the connection. In some cases, any
remaining data that is queued is sent out before the closesocket() is executed.
closesocket() syntax
int result = closesocket (SOCKET sd);
Here, sd is the SOCKET handle returned by the socket() system call before.
closesocket system call
int result = closesocket (...);
if (result == SOCKET_ERROR) /* error condition */
{...}
Upon success, closesocket() returns 0. In case of error, closesocket() returns
SOCKET_ERROR.

3.8 The shutdown() system call

The shutdown() system call is used to disable sends or receives on a socket.


shutdown() syntax
int result = shutdown (SOCKET sd, int how);
Here, sd is the SOCKET handle returned by the socket() system call before. The
parameter how determines how the shutdown is achieved. If the value of the parameter
how is SD_RECEIVE, further receives on the socket will be disallowed. If how is
SD_SEND, further sends are disallowed, and finally, if how is SD_BOTH, both sends and
receives on the socket are disallowed. Remember that the shutdown() function does not
close the socket. The socket is closed and all the associated resources are freed only after
a closesocket() call.
shutdown system call
int result = shutdown (...);
if (result == SOCKET_ERROR) /* error condition */
{...}
Upon success, shutdown() returns 0. In case of error, shutdown() returns
SOCKET_ERROR

RESULT : Studied about the various socket function calls.


82

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

83

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

7.2:- TCP-TWO WAY COMMUNICATION

OBJECTIVE:
To write a java program to implement two way communication using TCP(Transmission
Control Protocol).

ALGORITHAM:
SERVER:

1. Start the Program.


2. Import .net package and other packages.
3. Declare objects for Server4Socket,Socket and printStream to transfer
server data.
4. Declare objects for Socket and DataInputStream to receive client data.
5. Using printStream transfer the data in OutputStream via a port.
6. Run an loop to send data from server until an‖end or exit‖ String
is transferred.
7. Using the same loop receive data from server and store it in a String
using dataInputStream.
8. Print the String to display the server data and exit when an‖end or exit‖
Message is encountered.

CLIENT:

1.Start the program.


2.Import .net package and other packages.
3.Declare objects for Socket, Socket and PrintStream to transfer54 the client data.
4.Declare objects for Socket and DataInputStream to receive server the data.
5.UsingPrintStream transfer the data in OutputStream via a port.
6.Run an loop to send data from server until an ―end or exit‖string is transferred.
7.Using the same loop receive data from server and store it in a String using
DataInputStream.
8.Print the string to display the server data and exit when an ―send or exit‖ Message is
encountered.

84

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

SOURCE CODE:
CLIENT
import java.io.*;
import java.net.*;
importjava.lang.*;
class client1
{
public static void main(String a[])throws IOException
{
Socket s=new Socket("LocalHost",8000);
DataInputStream in=new DataInputStream(s.getInputStream());
DataInputStream inn=new DataInputStream(System.in);
PrintStream dos=new PrintStream(s.getOutputStream());
while(true)
{
String str=in.readLine();
System.out.println("msg received:"+str);
if(str.equals("end"))
{
s.close();
break;
}
System.out.println("enter the msg to send: ");
String str1=inn.readLine();
dos.println(str1);
if(str1.equals("end"))
{
s.close();
break;
}
}
}
}

85

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

SERVER

import java.io.*;
import java.net.*;
importjava.lang.*;
class server1
{
public static void main(String a[])throws IOException
{
ServerSocketss=new ServerSocket(8000);
Socket s=ss.accept();
PrintStream dos=new PrintStream(s.getOutputStream());
DataInputStream in=new DataInputStream(System.in);
DataInputStream inn=new DataInputStream(s.getInputStream());
while(true)
{
System.out.println("enter the msg to send: ");
String str=in.readLine();
dos.println(str);
if(str.equals("end"))
{
ss.close();
break;
}
String str1=inn.readLine();
System.out.println("msg received"+str1);
if(str1.equals("end"))
{
ss.close();
break;
}
}
}
}

86

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

87

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

OUTPUT:

SERVER
C:\>cd C:\Program Files\Java\jdk1.6.0\bin
C:\Program Files\Java\jdk1.6.0\bin>javac server1.java
C:\Program Files\Java\jdk1.6.0\bin>java server1
enter the msg to send:
HAI FRIENDS
msgreceived:HELLO
enter the msg to send:end
C:\Program Files\Java\jdk1.6.0\bin>
CLIENT
C:\>cd C:\Program Files\Java\jdk1.6.0\bin
C:\Program Files\Java\jdk1.6.0\bin>javac client1.java
C:\Program Files\Java\jdk1.6.0\bin>java client1
C:\Program Files\Java\jdk1.6.0\bin>java client1
msgreceived:HAI FRIENDS
enter the msg to send:
HELLO
enter the msg to send:end
C:\Program Files\Java\jdk1.6.0\bin>

RESULT: Thus the two way communication using TCP based on client-server model
has been successfully verified.

88

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

89

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

7.2:- IMPLEMENTATION OF FTP

AIM:
To write a socket program to perform “File Transfer Protocol”.

ALGORITHM

SERVER SIDE
1. Import the java packages and create class fileserver.
2. String of argument is passed to the args[].
3. Create a new server socket and bind it to the port.
4. Accept the client connection at the requested port.
5. Get the filename and stored into the BufferedReader.
6. Create a new object class file and readline.
7. If File is exists then FileReader read the content until EOF is reached.
8. Else Print FileNamedoes’t exits.
9. End of main.
10. End of FileServer class.

CLIENT SIDE
1. Import the java packages and create class fileClient.
2. String of argument is passed to the args[].
3. The connection between the client and server is successfully established.
4. The object of a BufferReader class is used for storing data content which have been
retrieved from socket object s.
5. The content are read and stored in inp until the EOF is reached.
6. The content of file are displayed in displayed in client window and the connection is
closed.
7. End of main.
8. End of Fileclient class.

SOURCE CODE
SERVER
import java.io.*;
import java.net.*;
public class fileserver1
{
public static void main(String args[])throws IOException
{
ServerSocket s1=null;
try
90

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

{
s1=new ServerSocket(1187);
}
catch(IOException u1)
{
System.out.println("could not found port 1187");
System.exit(1);
}
Socket c=null;
try
{
c=s1.accept();
System.out.println("connection frame" +c);
}
catch(IOException e)
{
System.out.println("accept failed");
System.exit(1);
}
PrintWriter out=new PrintWriter(c.getOutputStream(),true);
BufferedReader sin=new BufferedReader(new InputStreamReader(System.in));
System.out.println("enter the text file name");
String s=sin.readLine();
File f=new File(s);
if(f.exists())
{
BufferedReader in=new BufferedReader(new FileReader(s));
String v;
while((v=in.readLine())!=null)
{
out.write(v);
out.flush();
}
System.out.println("the file send successfully");
in.close();
c.close();
s1.close();
}
}
}

91

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

CLIENT

import java.io.*;
import java.net.*;
public class fileclient1
{
public static void main(String args[])throws IOException
{
Socket s=null;
BufferedReader b=null;
try
{
s=new Socket(InetAddress.getLocalHost(),1187);
b=new BufferedReader(new InputStreamReader(s.getInputStream()));
}
catch(Exception u)
{
System.out.println("the file is received");
System.out.println("don't know host");
System.exit(1);
}
String inp;
while((inp=b.readLine())!=null)
{
System.out.println("the content of the file is");
System.out.println(inp);
System.out.println("the file is received successfully");
}
b.close();
s.close();
}
}

92

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

93

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

OUTPUT:
SERVER
C:\>cd C:\Program Files\Java\jdk1.6.0\bin
C:\Program Files\Java\jdk1.6.0\bin>javac fileserver1.java
C:\Program Files\Java\jdk1.6.0\bin>java fileserver1
connectionframeSocket[addr=/127.0.0.1,port=1056,localport=1187]
enter the text file name
HAI.txt
the file send successfully
C:\Program Files\Java\jdk1.6.0\bin>

CLIENT
C:\>cd C:\Program Files\Java\jdk1.6.0\bin
C:\Program Files\Java\jdk1.6.0\bin>javac fileclient1.java
C:\Program Files\Java\jdk1.6.0\bin>java fileclient1
the content of the file is
GOD LOVE'S EVERY ONE IN THE WORLD.
the file is received successfully
C:\Program Files\Java\jdk1.6.0\bin>

RESULT:
The client – server model using FTP has been successfully verified.

94

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

95

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO: 8: - SOCKET PROGRAM FOR ECHO / PING / TALK COMMANDS

8.1: ECHO COMMAND

AIM:
To write a program in java to demonstrate the ECHO command.

ALGORITHM:

ECHOSERVER:

1. Start the program.


2. Import.net and other necessary packages.
3. Declare objects for DataInputStream, Socket and PrintWriter to receive server
message and send it back.
4. Store the message in a string and print the message using print() method.
5. Send the same received message to the server using PrintWriter and socket.
6. When the received message is end, then exit the program execution.

ECHOCLIENT:

1. Start the program.


2. Import.net and other necessary packages.
3. Declare objects for ServerSocket and Socket to send the message.
4. Declare objects for PrintStream to write message from server to client.
5. Get the user input and store it in a string.
6. Print the string in the socket using printStream to be received by the receiver.
7. Using the Print() method, receive the client echo message and print it.
8. If the message is end, terminate the program and exit.

96

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

SOURCE CODE:

ECHO SERVER

import java.io.*;
import java.net.*;
class echoserver
{
public static void main(String args[])
{
try
{
Socket s=null;
ServerSocket ss=new ServerSocket(8000);
s=ss.accept();
System.out.println(s);
BufferedReader br=new BufferedReader(new InputStreamReader(s.getInputStream()));
PrintWriter print=new PrintWriter(s.getOutputStream());
int i=1;
while(i>0)
{
String str=br.readLine();
if(str.equals("."))
break;
System.out.println("msg received by client:"+str);
print.println(str);
print.flush();
}
}
catch(IOException e)
{
System.out.println("\n error:"+e);
}
}
}

97

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

ECHO CLIENT

import java.io.*;
import java.net.*;
class echoclient
{
public static void main(String a[])
{
try
{
Socket s=new Socket("LocalHost",8000);
DataInputStream in=new DataInputStream(System.in);
BufferedReader br1=new BufferedReader(new InputStreamReader(System.in));
BufferedReader br2=new BufferedReader(new InputStreamReader(s.getInputStream()));
PrintWriter print=new PrintWriter(s.getOutputStream());
System.out.println("\n msg to be echo:");
String str=br1.readLine();
print.println(str);
print.flush();
System.out.println(br2.readLine());
}
catch(UnknownHostException e)
{
}
catch(IOException e)
{
System.out.println("\n error:"+e);
}
}
}

98

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

99

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

OUTPUT:
CLIENT
C:\>cd C:\Program Files\Java\jdk1.6.0\bin
C:\Program Files\Java\jdk1.6.0\bin>javac echoclient.java
C:\Program Files\Java\jdk1.6.0\bin>java echoclient
msg to be echo:
GOD IS GREAT
GOD IS GREAT
C:\Program Files\Java\jdk1.6.0\bin>

SERVER:
C:\>cd C:\Program Files\Java\jdk1.6.0\bin
C:\Program Files\Java\jdk1.6.0\bin>javac echoserver.java
C:\Program Files\Java\jdk1.6.0\bin>java echoserver
Socket[addr=/127.0.0.1,port=1623,localport=8000]
msg received by client:GOD IS GREAT
C:\Program Files\Java\jdk1.6.0\bin>

RESULT:
Thus the output for the ECHO command using java was executed and verified
successfully.

100

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

101

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

8.2: PING COMMAND

AIM:
To write a program in java to demonstrate the usage of PING command.

ALGORITHM:

1. Start the program.


2. Import.net and other necessary packages.
3. Initialize the ping server with both sockets as null value.
4. Start the serversocket.
5. At the client and give the IP address of the server.
6. The client program is then started by starting socket.
7. At the receiver end, the server is pinged.

SOURCE CODE:
PING SERVER
import java.io.*;
import java.net.*;
public class pingserver
{
public static void main(String a[])
{
String line1,line2;
int i;
ServerSocket es;
DataInputStream di;
PrintStream ps;
Socket csoc;
es=null;
csoc=null;
try
{
es=new ServerSocket(9999);
}
catch(Exception e)
{
System.out.println(e);
}
System.out.println("ping server");
try
{

102

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
csoc=es.accept();
di=new DataInputStream(csoc.getInputStream());
ps=new PrintStream(csoc.getOutputStream());
for(i=0;i<4;i++)
{
line1=di.readLine();
System.out.println("pinged by client");
ps.println(line1+"reply from host:bytes=3<time<1ms TT<=128");
}
di.close();
ps.close(); }
catch(Exception e)
{
System.out.println(e);
}
}
}
PING CLIENT

import java.io.*;
import java.net.*;
public class pingclient
{
public static void main(String args[])
{
PrintWriter out=null;
int i,j,k;
BufferedReader networkIn=null;
try
{
System.out.println("enter the IP address:");
DataInputStream in = new DataInputStream(System.in);
String ip = in.readLine();
Socket thesocket = new Socket(ip, 9999);
networkIn = new BufferedReader(new InputStreamReader(System.in));
out = new PrintWriter(thesocket.getOutputStream());
System.out.println("\npinging" + ip + "with 32 bytes of data\n");
for (i = 0; i < 4; i++)
{
out.println(ip);
out.flush();
String inp = networkIn.readLine();
if (inp != null)
{
for (j = 0; j < 10000; j++)
{
for (k = 0; k < 50000; k++)
103

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
{
}
}
System.out.println("reply from" + inp);
}
else
{
for (i = 0; i < 4; i++)
{
for (j = 0; j < 10000; j++)
{
for (k = 0; k < 50000; k++)
{
}
System.out.println("\nrequest time out");
}
}
}
}
}
catch (IOException e)
{
for (i = 0; i < 4; i++)
{
for (j = 0; j < 1000; j++)
{
for (k = 0; k < 5000; k++)
{
}
}
System.out.println("\nrequest timed out");
}
}
try
{
if(networkIn!=null)
networkIn.close();
if(out!=null)
out.close();
}
catch(Exception e){
System.out.println("\nrequested time out");
}
}
}

104

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

105

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

OUTPUT
PING CLIENT
C:\>cd C:\Program Files\Java\jdk1.6.0\bin
C:\Program Files\Java\jdk1.6.0\bin>javac pingclient.java
C:\Program Files\Java\jdk1.6.0\bin>java pingclient
enter the IP address:
192.168.1.10
pinging192.168.1.10with 32 bytes of data
5
reply from5
8
reply from8
9
reply from9
4
reply from4
C:\Program Files\Java\jdk1.6.0\bin>

PINGSERVER
C:\>cd C:\Program Files\Java\jdk1.6.0\bin
C:\Program Files\Java\jdk1.6.0\bin>javac pingserver.java
C:\Program Files\Java\jdk1.6.0\bin>java pingserver
ping server
pinged by client
pinged by client
pinged by client
pinged by client
C:\Program Files\Java\jdk1.6.0\bin>

RESULT:
Thus the output for the PING command using java was executed and verified
successfully.

106

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

107

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

8.3: TALK COMMAND

AIM:
To send and receive message from client and server using connection oriented service.

ALGORITHM:
SERVER:

1. Create server and client sockets.


2. Use input streams to get the message from user.
3. Use output stream to send message to the client.
4. Wait for client to display this message and write a new one to be displayed by the
server.
5. Display message given at client using input streams read from socket.
6. If in the message given by server or client, the word ―end‖ is encountered, exit both
the programs.

CLIENT:
1. Create a client socket that connects to the required host and port.
2. Using input streams read message given by server and print it.
3. Using input streams, get message from user to be given to the server.
4. Use output streams to write message to the server.

SOURCE CODE:
TALKSERVER:

import java.io.*;
import java.net.*;
public class talkserver
{
public static void main(String[] args)throws IOException
{
try
{
ServerSocket server=new ServerSocket(2000);
Socket client=server.accept();
System.out.println("connection established..");
DataInputStream dis=new DataInputStream(client.getInputStream());
PrintStream ps=new PrintStream(client.getOutputStream());
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String s="";
int i=0;
while(i<10)

108

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
{
System.out.println("from client:"+dis.readLine());
System.out.println("To client");
s=br.readLine();
if(s.equals("end"))
break;
}
ps.close();
dis.close();
br.close();
client.close();
server.close();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}

TALKCLIENT:
import java.io.*;
import java.net.*;
public class talkclient
{
public static void main(String[] args)
{
try
{
Socket server=new Socket("localhost",2000);
System.out.println("connected..");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
DataInputStream dis=new DataInputStream(server.getInputStream());
PrintStream ps=new PrintStream(server.getOutputStream());
int i=0;
String s=" ";
while(i<10)
{
System.out.println("\n Message to server:");
s=br.readLine();
ps.println(s);
if(s.equals("end"))
break;
System.out.println("\n Message from server:"+dis.readLine());
}
ps.close();

109

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

dis.close();
br.close();
}
catch(Exception e)
{
}
}
}

OUTPUT
Talk Client
C:\>cd C:\Program Files\Java\jdk1.6.0\bin
C:\Program Files\Java\jdk1.6.0\bin>javac talkclient.java
C:\Program Files\Java\jdk1.6.0\bin>java talkclient
Connected…..
Message to Server:
Hi How R You

C:\Program Files\Java\jdk1.6.0\bin>

TALK SERVER
C:\>cd C:\Program Files\Java\jdk1.6.0\bin
C:\Program Files\Java\jdk1.6.0\bin>javac talkserver.java
C:\Program Files\Java\jdk1.6.0\bin>java talkserver
Connection established……
From Client: Hi How R You
To Client
C:\Program Files\Java\jdk1.6.0\bin>

RESULT:
Thus the output for the TALK command using java was executed and verified
successfully.

110

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

111

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 9 : - IMPLEMENTATION OF ERROR DETECTION / ERROR


CORRECTION TECHNIQUES

AIM:
To implement the Error Detection and Error Correction using Hamming Codes.

SOURCE CODE:

Import java.util.*;
class hamming_code
{
static int set_parity_bit(int a[])
{
int count=0; //........Initialising count to zero which will count the number of 1.
int l=a.length;

for(int i=0;i<l;++i)
if(a[i]==1)
++count; //............Incrementing count if value in array "a" is 1.

if((count%2)==0)
return 0;//........Returning 0 if even number of 1
else
return 1;//........Returning 1 if odd number of 1
}
public static void main(String args[])
{
Scanner scr=new Scanner(System.in);
System.out.println("This is hamming code error detection and correction using EVEN parity");
System.out.println();
System.out.println("Enter 4 data bits.D4 D3 D2 D1");
int n=4; //set number of data bits
int d[]=new int[4]; //..........Array to accept data bits
for(int i=n-1;i>=0;--i)
{
System.out.println("Enter the value of D"+(i+1));
d[i]=scr.nextInt();
}

/*.............. Formula for calculating 2^k>=n+k+1 ...............*/

int k=0;// k stands for number of parity bits.Initializing it to zero.


112

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

while(Math.pow(2,k)<(n+k+1)) // Calculating the value of k(number of parity bits).


{
++k;
}
System.out.println();
System.out.println(k+" parity bits are required for the transmission of data bits.");

int p[]=new int[k]; //..........Array to store parity bits


int h[]=new int[n+k+1];//.........Array to hold the hamming code.(n+k+1) as we start from pos 1.

/********** Initialising array h[] to -1 ************/


for(int i=0;i<7;++i)
h[i]=-1;

int count=0;
int c=2;
while(count<4)
{
++c;
if(c==4)
continue;

h[c]=d[count];
++count;
}
int p1[]={h[1],h[3],h[5],h[7]};
int p2[]={h[2],h[3],h[6],h[7]};
int p3[]={h[4],h[5],h[6],h[7]};
int parity[]=new int[3];
/************Setting the value of parity bit*************/
parity[0]=set_parity_bit(p1);
parity[1]=set_parity_bit(p2);
parity[2]=set_parity_bit(p3);
/************Inserting the parity bits in the hamming code**********/
h[1]=parity[0];
h[2]=parity[1];
h[4]=parity[2];
System.out.println("\nSENDER:");
System.out.print("\nThe data bits entered are: ");
for(int i=3;i>=0;--i)
System.out.print(d[i]+" ");

113

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

System.out.println("\nThe Parity bits are: ");


for(int i=2;i>=0;--i)
System.out.println("Value of P"+(i+1)+" is "+parity[i]+" ");

System.out.print("\nThe Hamming code is as follows :-\nD4 D3 D2 P3 D1 P2 P1 \n");


for(int i=(n+k);i>0;--i)
System.out.print(h[i]+" ");

System.out.println();

System.out.println("\nEnter the hamming code with error at any position of your


choice.\nNOTE: ENTER A SPACE AFTER EVERY BIT POSITION.\nError should be present
only at one bit position");
for(int i=7;i>0;--i)
h[i]=scr.nextInt();

int p4[]={h[1],h[3],h[5],h[7]};
int p5[]={h[2],h[3],h[6],h[7]};
int p6[]={h[4],h[5],h[6],h[7]};

parity[0]=set_parity_bit(p4);
parity[1]=set_parity_bit(p5);
parity[2]=set_parity_bit(p6);

int position=(int)(parity[2]*Math.pow(2,2)+parity[1]*Math.pow(2,1)+parity[0]*Math.pow(2,0));
System.out.println("\nRECEIVER:");
System.out.println("Error is detected at position "+position+" at the receiving end.");
System.out.println("Correcting the error.... ");

if(h[position]==1)
h[position]=0;
else
h[position]=1;

System.out.print("The correct code is ");


for(int i=7;i>0;--i)
System.out.print(h[i]+" ");
}}

114

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

115

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
/* OUTPUT:
C:\Users\Aditya\Desktop>java hamming_code
This is hamming code error detection and correction using EVEN parity

Enter 4 data bits.D4 D3 D2 D1


Enter the value of D4
1
Enter the value of D3
0
Enter the value of D2
1
Enter the value of D1
0

3 parity bits are required for the transmission of data bits.

SENDER:

The data bits entered are: 1 0 1 0


The Parity bits are:
Value of P3 is 0
Value of P2 is 1
Value of P1 is 0

The Hamming code is as follows :-


D4 D3 D2 P3 D1 P2 P1
1010010

Enter the hamming code with error at any position of your choice.
NOTE: ENTER A SPACE AFTER EVERY BIT POSITION.
Error should be present only at one bit position
1010110

RECEIVER:
Error is detected at position 3 at the receiving end.
Correcting the error....
The correct code is 1 0 1 0 0 1 0
*/

SELF TEST
1. Can parity code detect even number of errors?
2. What is the full form of CRC?
3. What is the advantage with Hamming code?
4. What is error detection-correction overhead?

RESULT:
Thus the above program implemented using Hamming Code has been executed successfully.
116

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

117

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 10 : - ENCRYPTION AND DECRYPTION

OBJECTIVE:
Study of data encryption and decryption.

EQUIPMENTS:
• LTS-01 trainer kit
• 2 Computers with win-2K / XP and LAN card installed on them
• RJ-45 to RJ-45 LAN connecting cables
PROCEDURE:
1. Connect at least two computer LAN ports using RJ-45 to RJ-45 LAN connecting cables
provided with the system to LTS-01 star topology ports.
2. Switch on the LTS-01 & Computers.
3. Run L-SIM software on both the computers, one should be server and another should be
client.

4. On the server computer select type of network as LAN.

118

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

5. On the server computer select the topology as STAR and select protocol as Stop & Wait and
click on create network button.
6. Remote computer details will appear on the computers connected in network, server will be
able to see client and client will be able to see server.

7. Select the computer to whom data file is to be transferred, from the load button, previously
stored/selected file information can be loaded or you can select any file, which is to be
transmitted, if notepad text file is selected encryption information can be viewed very clearly for
each packet formed for that file.
8. File size will appear in the software window, select the packet size, inter packet delay and
click OK.
9. Total packets formed for that file will be indicated on computers, same details of file will
appear on remote computer to which file is to be transmitted.
10. Click on file transfer button to transfer file.
11. Click on pause button to interrupt file transfer and click on encrypt/decrypt button to see file
packet encrypted and decrypted.

119

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

12. You will see actual file content and encrypted data content in encryption details window.
13. You can type any text at the bottom box, which you want to encrypt and provide key text for
encryption. Similarly same key can be typed again to decrypt and recover encrypted text. If the
key at decryption stage differ from key at encryption stage, decrypted data will not be perfect as
per original data.

14. To understand the working of how encryption took place you can view visual explanation of
encryption and decryption process by clicking on visual help button.
15. You can resume file transfer by clicking on continue button.

120

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

121

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

16. Encrypted format of each packet can thus be seen by pausing the file transfer at respective
packet when it is under transmission state.
17. File transfer from one computer to another will take place.

VIVA QUESTIONS:

1. Define Encryption.

2. What is the process of Decryption

3. What is Public Key Encryption?

4. Define & List out the Conventional Encryption Standards.

5. Explain File Transfer Protocol.

OBSERVATION:
Thus the data encryption and decryption implemented and studied with the help of L-SIM &
LTS Trainer.

122

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

123

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

10.1: - SIMULATION OF ENCRYPTION – DECRYPTION USING C

AIM:

Write a program for encryption – Decryption using TURBOC

PROGRAM:

#include<stdio.h>
void main()
{
FILE *fp,*fp1;
intchoi;
char name[20],temp[20]={"Temp.txt"},c;
clrscr();
printf("Press 1 to Encrypt:Press 2 to Decrypt");
printf("Enter your Choice:");
scanf("%d",&choi);
switch(choi)
{
case 1:
printf("Enter the filename to Encrypt:");
scanf("%s",name);
fp=fopen(name,"r+");
if(fp==NULL)
{
printf("The file %s can't be open",name);
getch();
exit();
}
fp1=fopen(temp,"w+");
if(fp1==NULL)
{
printf("The file Temp can't be open");
getch();
exit();
}
c=fgetc(fp);
while(c!=EOF)
{
fputc((c+name[0]),fp1);printf("%c",c+name[0]);getch();
c=fgetc(fp);
}
fclose(fp);
124

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

fclose(fp1);
remove(name);
rename(temp,name);
printf("The file is Encrypted:");
getch();
break;
case 2:
printf("Enter the Filename to Decrypt:");
scanf("%s",name);
fp=fopen(name,"r+");
fp1=fopen(temp,"w+");
c=fgetc(fp);
while(c!=EOF)
{
fputc(c-name[0],fp1);
c=fgetc(fp);
}
fclose(fp);
fclose(fp1);
remove(name);
rename(temp,name);
printf("The file is decrypted:");
getch();
}
}

125

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

OUTPUT:

TO COMPILE: Press ALT + F9

TO RUN: Press CTRL + F9

# Press 1 to Encrypt Press 2 to Decrypt


1
Enter the file name to Encrypt : temp.txt
$*&@@@$%^@#^@#^&

# Press 1 to Encrypt Press 2 to Decrypt


2
Enter the file name to Decrypt: temp.txt
Hi how are you….

RESULT:
Thus the data encryption and decryption implemented and studied using TURBOC

126

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

127

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 11 : - STUDY OF NETWORK SIMULATOR(NS) & SIMULATION OF


CONGESTION CONTROL ALGORITHM USING NS2

11.1: STUDY OF NETWORK SIMULATORS

Aim:
To study of different wireless network simulators and observe the comparison table of each
simulator.

THEORY:

1.1 GLOMOSIM/QUALNET:

Glomosim known as Global Mobile Information System simulator is a public domain simulator
developed by UCLA.Ithas scalable environment for large wireless and the communication for
wire line networks. GlomoSim is used for parallel discrete-event simulation .This capability is
provided by Parsec. Commercial tool of GloMosim is QuaNet. It is derived from the GloMoSim
that was first released in 2000 by SNT .The main differences between QualNet and GloMoSim
are(1) Qualnet is based on C++ but GloMoSim is based on the C Parsec language.(2)Qualnet is a
Commercial Product, butthe GloMosim is distributed under an open source license. (3) Qualnet
is maintained by SNT, but the GloMosim is maintained by Parallel Computing. Qualnet
Architecture is composed of (1) Qualnet kernel: The kernel of Qualnet is a parallel discrete-event
scheduler. It provides the scalability and portability to run hundreds and thousands of nodes with
high-fidelity models on a variety of platforms, from laptops and desktops to high performance
computing systems.(2)QualNet Model Libraries: QualNet supports a number of model libraries
that enables to design networks using various protocol models. QualNet includes the Developer,
Multimedia and Enterprise, and Wireless Model Libraries. Additional libraries such as cellular
networks, satellite networks, UMTS, WiMAX, sensor networks, military radio networks, and
advanced propagation model libraries are also available.(3)QualNet Graphical User Interface:
QualNet GUI consists of Architect, Analyzer, Packet Tracer, and File Editor. Architect is a
network design and visualization tool. Analyzer is a statistical graphing tool that displays
hundreds of metrics collected during simulation of a network scenario. Packet Tracer provides a
visual representation of packet trace files generated during the simulation of a network scenario.
File editor is a text editing tool.(4)QualNet Command Line Interface: The QualNet command
line interface enables a user torun QualNet from a DOS prompt (in Windows) or from a
command window (in Linux). Qualnet enables users to design new protocol models, optimize
new and existing models, Design large wired and wireless networks using preconfigured or user-
designed models and analyze the performance of networks . Qualnet can support real-time speed
to enable software-in-the-loop, network emulation, and hardware-in-the-loop modeling. QualNet
can model thousands ofnodes. QualNet can run on cluster, multi-core, and multi-processor
systems to model large networks with high fidelity. Qualnet can communicate with other
simulators through HLA module. The QualNet advantages are the

128

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

complete GUI provided, which is, in our opinion, simpler to use than the OPNET one. It shows a
very good scalability, simulation time being reasonable, even on a laptop or desktop computer
(tens of thousands of nodes including mobility and high traffic can be simulated in relatively
short simulation times). However, some features are not clearly detailed. For example,
QualNet allows the modeling of new protocols with the GUI as well as by directly coding the
protocol. Nevertheless, it makes not clear that new components can be created

2.2 OMNet++
OMNeT++ is an open source, component-based, modular and open architecture environment for
discrete event simulation. It is free of charge for academic and non-profit use. Its primary
application area is the simulation of communication networks, but its generic and flexible
architecture makes it possible to use it in other areas like the simulation of complex IT systems,
queuing networks or hardware architectures. OMNeT++ is not a network simulator; however, it
is currently gaining popularity as a network simulation platform in the scientific community as
well as in industrial ones, and building up a large user community. OMNeT++ runs on Linux,
other Unix-like systems and on Windows (XP, Win2K) OS platforms. OMNet++ is composed of
(1) Graphical network editor: A graphical network editor (GNED) to allow graphical topology
build, creating files in the Network Description (NED) language (2) Kernel library: A simulation
Kernel library contains definitions of objects used for the topology creation (3) Command line
interface: Includes Graphical and command line interfaces for simulation execution (4) A model
documentation tool for documentation. Two kinds of modules exist: simple modules and
compound modules. Compound modules are a set of simple modules. These modules are
assembled into larger components and models using a high-level Network Description (NED)
language, allowing a hierarchical organization of the network. These compound modules allow
simulation of large-scale networks. Modules communicate by message exchanges. These
messages may represent, for instance, packets in communication networks or jobs in queuing
networks. They are sent from a simple module to another simple module, either directly to their
destination or along a predefined path. Messages are exchanged through gates and connections
OMNeT++ offers the possibility either to modify existing models or to create new object classes
that may be derived from basic object classes (module, gate, connection, etc.). Modules types
can be stored in separate files. This allows the user to group existing module types and to
compose component libraries. OMNeT++ implements a deterministic modeling formalism. But
it also handles continuous and discrete stochastic variables that give randomness to the model.
OMneT ++ has a separate window for each modules text output. Scheduled messages can be
watched as the simulation progresses, Event–by-event execution .Execution animations.
Graphical display of simulation results during execution.

129

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

2.3 NS-2
It is a public domain event-driven network simulator developed at UC Berkeley. It is available
on UNIX, Free BSD and Windows OS platforms. NS-2 is currently a part of the VINT (Virtual
Inter-Network Test bed) project [VINT]. NS-2 is designed to simulate small-scale networks. NS-
2 is based on three languages: TCL writes simulation script, OTCL defines simulation parameter,
C++ implements the schedulers. The outputs produced by NS-2 can be: General format trace
files, NAM format trace files, Personalized trace files.Ns-2 is cheap, complex scenarios can be
easily tested, results can be quickly obtained, supports platform and protocols and popular. Main
disadvantage is that real time system too complex to model and scalability issue.

2.4 OPNET
It provides a global environment to model, simulate and evaluate performances of all kinds of
wired and wireless communication networks and distributed systems. It is available on Windows
2000, XP, Linux and Solaris platforms. The OPNET environment includes graphical tools for
scenarios and models conception, scenarios simulation, data collection and data analysis. A
simulation within OPNET is represented by a project including a set of scenarios. This project is
created through the project editor also known as the OPNET central interface. All the available
functionalities may be accessed from this editor. It provides an access to other editors that
propose functions including node and process model creation, building packet formats, and
creating filters and parameters. OPNET provides many additional functions including a High-
Level Architecture (HLA) module, which allows communication between various simulators.
OPNET allows hierarchical modeling by defining a network as a collection of sub-models
representing sub-networks or nodes. Modeling is done within the modeling environment, which
consists of three domains. (1)The network domain. It defines the communication network
topology to simulate. (2) The node domain. The node domain instantiates the nodes defined in
the network domain, i.e. elements connected to the network that can send and receive data(3)
The process domain The process domain describes every module (processors or queues) that is
programmable by the user. They execute processes or tasks. The visualization and analysis of
results is achieved with the Analysis Tool and the Filter Editor. The Analysis Tool displays the
results of a simulation or series of simulations as graphs. Although simulation results can be
viewed in the Project Editor. OPNET modeling modularity is an asset to model critical
infrastructures. It offers the possibility to define and add new models specific to the
infrastructure to simulate. New parameters can also be specified to model actions that might
occur within the infrastructure (management, processing, etc.). Infrastructures can be
distinguished by the process models (i.e.: the codes or programs that characterize the state of the
modules associated to a node or a link).However, this tool is quite complex, especially if specific
component have to be developed.

2.5 J-SIM
J-Sim (Java Simulator) is a free of charge implementation for simulation of a component-based
architecture, the Autonomous Component Architecture (ACA). The ACA mimics the integrated
circuit design and manufacturing model in terms of how components are specified, designed and
assembled [J-Sim]. J-Sim includes a specific platform, dedicated to network simulation, the
Internetworking Simulation Platform called INET, but is not limited to this field. Its organization
is similar to the one of OMNeT++. J-Sim is a real-time process-driven simulator, in other words,
130

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

131

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

a simulation runs in the same manner as a real system does, in the sense that event executions are
carried out in real time as opposed to at fixed time points in discrete event simulation. As in NS-
2, two languages are used in J-Sim: Java to describe and implement models and a script language
to construct, configure and/or control the simulation at run-time. JSim has been designed to
support Tcl, Perl or Python script languages, however, the available implementation is based on
Tcl. J-Sim provides specific Tcl commands, the Runtime Virtual (RUV) commands, to simplify
the manipulation and the configuration of the network components during simulation runtime. J-
Sim includes the INET platform that is dedicated to network simulation the simulation results
can be collected of three ways: Trace files, X-Y graph and NAM

RESULT:
Fast simulation capabilities are only supported by Qualnet and Opnet. Qualnet and
Opnet are commercial whereas Ns-2, Omnet++ and J-Sim are open source.

132

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

A Simple Network Topology and Simulation Scenario

133

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

11.2: CONGESTION CONTROL USING TCP & UDP:

AIM:
To analyze the performance of TCP&UDP congestion control algorithm using NS2.

APPARATUS REQUIRED:
System with installed NS2, Ubuntu OS

PROGRAM:

# create a simulator object


set ns [new Simulator]

# define different colors for nam data flows


$ns color 1 blue
$ns color 2 red
$ns color 3 green
$ns color 4 yellow

# open the nam trace file


set nam_trace_fd [open task1_out.nam w]
$ns namtrace-all $nam_trace_fd

# necessary to remember the old bandwidth


set packetSize 1000

#Define a 'finish' procedure


proc finish {} {
global ns nam_trace_fd

# close the nam trace file


$ns flush-trace
close $nam_trace_fd

# execute nam on the trace file


exit 0
}

# create four nodes


set node1 [$ns node]
set node2 [$ns node]
set node3 [$ns node]
set node4 [$ns node]

134

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

135

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
# create links between the nodes
$ns duplex-link $node1 $node3 2Mb 10ms DropTail
$ns duplex-link $node2 $node3 2Mb 10ms DropTail
$ns duplex-link $node3 $node4 1Mb 10ms DropTail
$ns queue-limit $node3 $node4 4

# monitor the queue for the link between node 2 and node 3
$ns duplex-link-op $node3 $node4 queuePos 0.5

# Setting for nam


$ns duplex-link-op $node1 $node3 orient right-down
$ns duplex-link-op $node2 $node3 orient right-up
$ns duplex-link-op $node3 $node4 orient right

# TCP traffic source


# create a TCP agent and attach it to node node1 set tcp [new Agent/TCP]
$ns attach-agent $node1 $tcp
$tcp set fid_ 1 # blue color
$tcp set class_ 1

# window_ * (packetsize_ + 40) / RTT


$tcp set window_ 30
$tcp set packetSize_ $packetSize

# create a TCP sink agent and attach it to node node4


set sink [new Agent/TCPSink]
$ns attach-agent $node4 $sink

# connect both agents


$ns connect $tcp $sink

# create an FTP source "application";


set ftp [new Application/FTP]
$ftp attach-agent $tcp

# UDP traffic source


# create a UDP agent and attach it to node 2
set udp [new Agent/UDP]
$udp set fid_ 2 # red color
$ns attach-agent $node2 $udp

# create a CBR traffic source and attach it to udp


set cbr [new Application/Traffic/CBR]
$cbr set packetSize_ $packetSize
$cbr set rate_ 0.2Mb
$cbr set random_ false
136

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

137

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

$cbr attach-agent $udp

# creat a Null agent (a traffic sink) and attach it to node 4


set null [new Agent/Null]
$ns attach-agent $node4 $null
$ns connect $udp $null

# schedule events for all the flows


$ns at 0.1 "$ftp start"
$ns at 0.1 "$cbr start"
$ns at 5.0 "$cbr stop"
$ns at 5.0 "$ftp stop"

# call the finish procedure after 6 seconds of simulation time


$ns at 6 "finish"

# run the simulation


$ns run

To RUN

Step 1: Open Notepad and type the program.


Step 2: Save the file in .tcl format
Step 3: for running the program $ns filename.tcl
Step 4: for network animated window type task1_out

RESULT:

Thus the performance of TCP/UDP congestion control algorithm using NS2 has been analyzed.
138

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

139

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 12 : - PC – PC COMMUNICATION
OBJECTIVE:
To study Parallel Communication using 8 bit parallel cable.

EQUIPMENTS:
• DCT-03.
• 9 Pin D connector Cables – 2 Nos.
• 25 Pin D connector Cables – 2 Nos.
• Computers – PC - 2 nos.
• Connecting Chords.
• Power Supply.

PROCEDURE:
PARALLEL COMMUNICATION:
1. Carry out the following connections and settings as shown in the diagram.
2. Keep all switch fault switches in off position.
3. Keep switch SW6 in PC mode.
4. Connect LPT/parallel port of one PC to connector CN1 on left hand side on DCT-03 kit using
25-25 pin D type cable. Similarly connect LPT/parallel port of another PC to connector CN2 on
right hand side on DCT-03 kit using 25-25 pin D type cable.
5. Keep the switch settings for SW1, SW2 & SW3 in ON position as shown.
6. Switch ON the power supply.
7. Run DCT software

140

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

8. Clicking on Port Setting will show you three ports (i.e. LPT1, LPT2, LPT3), select the port
from the user machine through which the data transfer has to occur. For example Clicking on
LPT1 will set the LPT1 as the active port on the machine for the data transfer.
9. Please ensure that the selected ports are in bi-directional mode, this can be checked from the
BIOS settings of the computer.

10. Clicking on Protocols will show you three protocols namely Stop and Wait Protocol, Go
Back N Protocol and Selective Repeat protocol. Select Same protocol on both PC. Screen similar
to one given below will appear.

141

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

11. Select one PC in transmit mode and another PC in receive mode.


12. Select the file to be sent from the transmitter computer, the screen shown below will appear
at transmitter side, with details of file selected number of packets formed using 128 byte per
packet size.
13. Inter packet delay can be varied from 5 ms to 100 ms.
14. Window size for Go back N & Selective Repeat protocols can be selected from 3, 5, 7.
15. Packets to be sent are shown with blue colour.

16. Click on Transmit file button.

142

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

17. On the remote PC click on receive file button.


18. Status of file transfer will be indicated on screen with different colour coding depending on
the status of packet whether it is sent & acknowledged, sent but not acknowledged, bad packet
error in packet.
19. After the user has selected the file. The PC shows the No of Packets and Size of the file in
the boxes on the top. The Packets with their packet sequence is also shown.
20. Once the transfer starts and the client computer acknowledges the packets it sends the signal
back to the transmitting PC. Any acknowledge positive or negative with their packet sequence is
displayed below the Current Packet No.
21. Any positive acknowledge received is displayed as ACK(0) and any negative acknowledge is
displayed as NACK(0) along with their packet sequence in brackets.
22. Once the packet has been acknowledged and signal shown the next packet is transmitted and
so on till the whole file gets transmitted.
23. On the right hand top shows frame info. The frame info consists of different color packets.
Each color specifies different status of the packet.
24. Observe the effect on file transfer by introducing error in data bits use switch SW2 to
introduce error for a moment.

143

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
25. Once the file transfer gets complete you will be prompted by file transfer successful at
transmitter.

26. At the receiver a selection window will popup to indicate location for the received file to be
saved.

27. Verify the received file with transmitted file, this shows end of file transfer with success.
28. The receiving packets can be discarded or killed by clicking the Discard button.
29. Any acknowledge that is transmitted back can be also made to lost by just clicking Lost
button. Thus the Transmitter side will not receive any acknowledge.
30. The third button NACK/LOST can be clicked to discard and to lose any acknowledge
sending back to the Transmitter simultaneously.
31. Similarly other Parallel port file transfer protocols can be studied with the effects of fault in
packets.

RESULT:
Thus the implementation of serial communication and parallel communication were studied with
the help of DCT Trainer using RS232 cable

144

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

145

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

EXT NO : 13 :- CONNECTING A COLLEGE CAMPUS THROUGH WIRELESS LAN


USING OPNET
AIM: To simulate different subnets for different departments of a campus and
connect them together.
The Description:
1. Add to the project workspace the following objects from the palette: Application Config,
Profile Config, and a subnet. Application Config is used to specify applications that will be used
to configure users profiles. Profile Config describes the activity patterns of a user or group in
terms of the applications used over a period of time.
2. Right-click on the subnet node, edit attributes, change the name attribute to Engineering
and click OK.
3. Double-click on the Engineering node. You get an empty workspace, indicating
that the subnet contains no objects.
4. Open the Object Palette and make sure it is still set to internet toolbox.
5. Add the following items to the subnet workspace: 10BaseT LAN, ethernet16Switch, and
a 10BaseT link to connect the LAN with the Switch. Close the palette.

6. Right-click on the 10BaseT LAN node. Edit attributes and change the name of attribute to
LAN and observe that the Number of Workstations attribute has a value of 10.

7. Click in the Value column for the Application: Supported Profiles attribute, and select Edit.
You should get a table in which you should do the following:

a. Set the number of rows to 1


b. Set the Profile Name to Engineer. (Engineer is one of the ―sample‖ profiles
provided within the Profile Config object.)
8. The object we just created is equivalent to a 10-workstation
Star topology. The traffic generated from the users of this LAN resembles that generated by
―engineers‖.

9. Make three copies of the Engineering subnet we just created. Click on the Engineering node.
From the Edit menu, select Copy and then Paste three times, placing the subnet in the
workspace after each, to create the new subnets.

10. Configure the Servers:

146

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
Now we need to implement a subnet that contains the servers. The servers have to support

The figure-1 shows the servers subnet inside which there are individual servers for different
purposes and are interconnected.

147

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

the applications defined in the profiles we deployed. You can double- check these
applications by editing the attributes of our Profile node. Inspect each row under the
Applications hierarchy, which in turn, is under the Profile Configuration hierarchy. You
will see that we need servers that support the following applications: Web browsing, Email,
Telnet, File Transfer, Data base & File print.

The figure-2 shows each of the different departments’ subnets.

148

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

The figure-3 shows the overview of the entire network.

149

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

OUTPUT

150

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

151

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

NETWORK SIMULATOR
TOOLS

152

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

1. Cloonix

web: http://clownix.net/

Description: Cloonix is a Linux router and host simulation platform. It fully encapsulates
application, host, and network l2 and l3 into a relatively easy-to-use simulation GUI. Network
delay and loss characteristics can be configured per link. It provides support for running kvm or
UML virtual machines configured into an arbitrary complex network configuration. It is possible
to run a 12 router UML simulation on a small x86 host (a P4 with 512 MB RAM). 32- and 64-bit
KVM machines are provided.

Common Open Research Emulator

Web: http://www.nrl.navy.mil/itd/ncs/products/core

Description: The Common Open Research Emulator (CORE) is a tool for emulating networks
on one or more machines. You can connect these emulated networks to live networks. CORE
consists of a GUI for drawing topologies of lightweight virtual machines, and Python modules
for scripting network emulation.

2. GNS3

web: http://www.gns3.net/

Description: GNS3 is an open source software (under GPL) that simulate complex networks
while being as close as possible to the way real networks perform. All of this without having
dedicated network hardware such as routers and switches (focusing no Cisco and Juniper).

Our software provides an intuitive graphical user interface to design and configure virtual
networks, it runs on traditional PC hardware and may be used on multiple operating systems,
including Windows, Linux, and MacOS X.

GNS3 can also be used to simulate a network composed exclusively of VirtualBox and/or Qemu
virtual machines running open-source software. GNS3 provides a variety of prepared open-
source virtual appliances, and users can create their own.

153

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

3. IMUNES

web: http://www.imunes.net/

Description: As invaluable tools in networked and distributed systems research, network


emulators offer a viable alternative to live experimental / testbed networks. We are developing a
realistic network topology emulation / simulation framework based on the FreeBSD operating
system kernel partitioned into multiple lightweight virtual nodes, which can be interconnected
via kernel-level links to form arbitrarily complex network topologies. The concept of using
virtual nodes inside a kernel for fast network emulation is not entirely new, yet previously
published work generally advocated the implementation of kernel-level virtual nodes with
capabilities limited to only certain simple functions, such as passing of network frames from one
queue to another based on a static precomputed path. We are basing our work on a thesis that
virtual nodes, which could offer the identical rich set of capabilities as the standard kernel does,
can be implemented very efficiently by reusing the existing OS kernel code. Our model therefore
not only provides each node with an independent replica of the entire standard network stack,
thus enabling highly realistic and detailed emulation of network routers; it also enables each
virtual node to run a private copy of any unmodified user-level application, including routing
protocol daemons, traffic generators, analyzers, or application servers. Furthermore, in later
development phases we expect to enable each virtual node to support multiple network protocols
concurrently, such as both IPv4 and IPv6, which would bring us a step closer to allowing for
emulation of true multiprotocol networked environments.

4 Marrionet

web: http://www.marionnet.org/

Description: Marionnet is a virtual network laboratory: it allows users to define, configure and
run complex computer networks without any need for physical setup. Only a single, possibly
even non-networked GNU/Linux host machine is required to simulate a whole Ethernet network
complete with computers, routers, hubs, switches, cables, and more. Support is also provided for
integrating the virtual network with the physical host network.

5.Mininet

web: http://mininet.org/

Description: Mininet creates a realistic virtual network, running real kernel, switch and
application code, on a single machine (VM, cloud or native), in seconds, with a single
command.

154

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY
Mininet is designed to support research in Software Defined Networking technologies. It uses
Linux network namespaces as its virtualization technology to create virtual switches and virtual
nodes. The web site indicates that the tool can support thousands of virtual nodes on a single
operating system. Mininet is most useful to researchers who are building SDN controllers and
need a tool to verify the behavior and performance of SDN controllers. Knowledge of the Python
scripting language is very useful when using Mininet.

6. MLN

web: http://mln.sourceforge.net/index.php

Description: MLN (Manage Large Networks) is a virtual machine administration tool designed
to build and run virtual machine networks based on Xen, VMware Server and User-Mode Linux.
It is ideal for creating virtual network labs for education, testing, hosting or simply playing
around with virtual machines.

7. NS-2

web: http://nsnam.isi.edu/nsnam/index.php/User_Information
, http://nsnam.isi.edu/nsnam/index.php/Main_Page

Description: Ns is a discrete event simulator targeted at networking research. Ns provides


substantial support for simulation of TCP, routing, and multicast protocols over wired and
wireless (local and satellite) networks.

Ns began as a variant of the REAL network simulator in 1989 and has evolved substantially over
the past few years. In 1995 ns development was supported by DARPA through the VINT project
at LBL, Xerox PARC, UCB, and USC/ISI. Currently ns development is supported through
DARPA with SAMAN and through NSF with CONSER, both in collaboration with other
researchers including ACIRI. Ns has always included substantal contributions from other
researchers, including wireless code from the UCB Daedelus and CMU Monarch projects and
Sun Microsystems.

155

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

8. NS-3

web: http://www.nsnam.org/

Description: Ns-3 is a discrete-event network simulator for Internet systems, targeted primarily
for research and educational use. ns-3 is free software, licensed under the GNU GPLv2 license,
and is publicly available for research, development, and use.

The goal of the ns-3 project is to develop a preferred, open simulation environment for
networking research: it should be aligned with the simulation needs of modern networking
research and should encourage community contribution, peer review, and validation of the
software.

9. Omnet++

web: http://www.omnetpp.org/

Description: OMNeT++ is an extensible, modular, component-based C++ simulation library and


framework, primarily for building network simulators. "Network" is meant in a broader sense
that includes wired and wireless communication networks, on-chip networks, queueing
networks, and so on. Domain-specific functionality such as support for sensor networks, wireless
ad-hoc networks, Internet protocols, performance modeling, photonic networks, etc., is provided
by model frameworks, developed as independent projects. OMNeT++ offers an Eclipse-based
IDE, a graphical runtime environment, and a host of other tools. There are extensions for real-
time simulation, network emulation, alternative programming languages (Java, C#), database
integration, SystemC integration, and several other functions.

10 . Opnet Modeler - new - Riverbed Modeler

web: http://www.riverbed.com/products/performance-management-control/network-
performance-management/network-simulation.html

Description: Riverbed Modeler - discrete event-simulation engine for analyzing and designing
communication networks. Riverbed Modeler comprises of a suite of protocols and technologies
with a sophisticated development environment. By modeling all network types and technologies
(including VoIP, TCP, OSPFv3, MPLS, IPv6, and more), Riverbed Modeler analyzes networks
to compare the impact of different technology designs on end-to-end behavior. Modeler lets you
test and demonstrate technology designs before production; increase network R&D productivity;
develop proprietary wireless protocols and technologies; and evaluate enhancements to
standards-based protocols.

156

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

11. Packet Tracer

web: https://www.netacad.com/web/about-us/cisco-packet-tracer

Description: Cisco Packet Tracer is a powerful network simulation program that allows students
to experiment with network behavior and ask ―what if‖ questions. As an integral part of the
Networking Academy comprehensive learning experience, Packet Tracer provides simulation,
visualization, authoring, assessment, and collaboration capabilities and facilitates the teaching
and learning of complex technology concepts.

Packet Tracer supplements physical equipment in the classroom by allowing students to create a
network with an almost unlimited number of devices, encouraging practice, discovery, and
troubleshooting. The simulation-based learning environment helps students develop 21st century
skills such as decision making, creative and critical thinking, and problem solving. Packet Tracer
complements the Networking Academy curricula, allowing instructors to easily teach and
demonstrate complex technical concepts and networking systems design.

The Packet Tracer software is available free of charge to Networking Academy instructors,
students, alumni, and administrators who are registered NetSpace users.

Licence: Free for Cisco Netacad program members

12. Psimulator2

web: https://code.google.com/p/psimulator/

Description: Psimulator2 is simple graphical linux and cisco network simulator created for
education purposes - learning IP networks basis. It allows building virtual network consisted of
linux and (basic) cisco routers and simple switches. Virtual network can be easily and quickly
created in graphical user interface. Network devices (linux and cisco routers) are configured via
command line over telnet protocol. Telnet client is included in GUI or different client (putty,
linux telnet) can be used. GUI is designed to capture and display packets in virtual network (like
Wireshark). Virtual network can be connected to real network.

157

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


EC6611 - COMPUTER NEWORKS LABORATORY

13. Virtualsquare

web: http://wiki.virtualsquare.org/wiki/index.php/Main_Page

Description: Virtual Square is the name of a project that includes several software tools and
libraries. Its main goal is to create an unified environment that allows virtual machines, systems
and networks to communicate and interact.

14. VNX and VNUML

web: http://web.dit.upm.es/vnxwiki/index.php/Main_Page

Description: VNX is a general purpose open-source virtualization tool designed to help building
virtual network testbeds automatically. It allows the definition and automatic deployment of
network scenarios made of virtual machines of different types (Linux, Windows, FreeBSD,
Olive or Dynamips routers, etc) interconnected following a user-defined topology, possibly
connected to external networks.

VNX has been developed by the Telecommunication and Internet Networks and Services (RSTI)
research group of the Telematics Engineering Department (DIT) of the Technical University of
Madrid (UPM).

VNX is a useful tool for testing network applications/services over complex testbeds made of
virtual nodes and networks, as well as for creating complex network laboratories to allow
students to interact with realistic network scenarios. As other similar tools aimed to create virtual
network scenarios (like GNS3, NetKit, MLN or Marionnet), VNX provides a way to manage
testbeds avoiding the investment and management complexity needed to create them using real
equipment.

158

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Вам также может понравиться