Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as pdf or txt
Download as pdf or txt
You are on page 1of 62

TAGORE INSTITUTE OF ENGINEERING AND

TECHNOLOGY
Deviyakurichi-636112, Attur (TK), Salem (DT). Website: www.tagoreiet.ac.in
(Approved by AICTE, New Delhi and Affiliated to Anna University, Chennai)
Accredited by NAAC

Department of Electronics and Communication

Engineering
III Year- V Semester - Electronics and Communication Engineering

EC8563 – Communication Networks Laboratory

LAB MANUAL

Academic Year 2020-2021

(2017 Regulation)

Page 1 of 62
DEPARTMNET OF ELECTRONICS AND COMMUNICATION ENGINEERING
V SEM – E.C.E
EC8563 – COMMUNICATION NETWORKS LABORATORY

S.NO NAME OF EXPERIMENTS

1. Implementation of Error Detection / Error Correction Techniques

2. Implementation of Stop and Wait Protocol

3. Implementation and Study of Goback-N and Selective Repeat


Protocols

4. Implementation of High Level Data Link Control

5. Implementation of IP Commands such as ping, Traceroute, nslookup

6. Implementation of IP Address Configuration

7. Performance Analysis of CSMA/CA and CSMA/CD Protocols

8. Network Topology – Star, Bus and 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. Implementation of Data Encryption and Decryption Algorithms

Page 2 of 62
DEPARTMENTOFELECTRONICS&COMMUNICATION
ENGINEERING

V SEM– E.C.E.

EC8563 -COMMUNICATION NETWORKS LABORATORY

CYCLE I

1. Implementation of Error Detection / Error Correction Techniques


2. Implementation of Stop and Wait Protocol
3. Implementation and Study of Goback-N and Selective Repeat Protocols
4. Implementation of High Level Data Link Control

5. Implementation of IP Commands such as ping, Traceroute, nslookup

6. Implementation of IP Address Configuration

CYCLEII

7. Performance Analysis of CSMA/CA and CSMA/CD Protocols


8. Network Topology – Star, Bus and 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. Implementation of Data Encryption and Decryption Algorithms

Page 3 of 62
Ex. No: 1 Implementation of Error Detection / Error Correction Techniques

AIM:
To Implement the error detection and error correction protocol.

APPARATUS REQUIRED:
• LTS-01 trainer kit
• 3 Computers with win-2K / XP and Ethernet port available on them
• RJ-45 to RJ-45 LAN connecting cables
• L-SIM LAN protocol analyzer and simulator software

ERROR CORRECTION
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.
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 on other computers, 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.
16. Close file transfer window and click on protocol analyzer and Network analyzer
buttons on transmitter computer to view details of the log created.
17. Under Network analyzer window click on Graph analyzer button.
18. Calculate throughput and click on Plot graph button.

ERROR DETECTION

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 an CSMA-CD

Page 4 of 62
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 get initiated.
12. Once the first sender file reached to server its display is refreshed and server will show
packet status for second sender.
13. Second sender file transfer will also get completed and thus collision of two packets
transmitted simultaneously from two senders is detected and cleared.
14. Multiple file transfer between various server-client combinations should be performed
to observe throughput v/s packet size graph on transmitter computer.
15. Close file transfer window and click on protocol analyzer and Network analyzer
buttons on transmitter computer to view details of the log created.
16. Under Network analyzer window click on Graph analyzer button.

OUTPUT:

Page 5 of 62
RESULT:
Thus the Error detection and correction protocol was implemented by using L-sim software.

Page 6 of 62
Ex. No: 2 Implementation of Stop and Wait Protocol

AIM:
To implement the Stop & Wait protocol using parallel port & LAN port interface.

APPARATUS REQUIRED:
• LTS-01 trainer kit.
• 2 Computers with win-2K / XP and Ethernet port available on them
• RJ-45 to RJ-45 LAN connecting cables.
• L-SIM LAN protocol analyzer and simulator software

PROCEDURE:
Connect 2 computer LAN ports using RJ-45 to RJ-45 LAN connecting cables provided with
the system to LTS-01 star topology ports.
1. Switch on the LTS-01 & Computers.
2. Run L-SIM software on all the computers, one should be server and others should be
clients.
3. On the server computer select type of network as LAN.
4. On the server computer select the topology as STAR, select protocol as Stop & Wait click
on create network button.
5. 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.
6. 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.
7. File size will appear in the software window, select the packet size, inter packet delay and
click OK.
8. Total packets formed for that file will be indicated on computers.
9. Same details of file will appear on remote computer to which file is to be transmitted.
Click on file transfer button to transfer file.
Transmission started screen in receiver
10. During file transfer process you can insert errors into data packets being transmitted
through software window.
11. See the effect of Bad packet error, Packet negative acknowledgment error or auto errors
on file transfer.
12. See the effect of Bad packet error, Packet negative acknowledgment error or auto errors
on file transfer.
13. Select BAD PACKET error and click on Generate button in the transmitter window when
say 7th packet is in the transmission state.
14. You will see that 7th packet in the receiver window will be marked as bad packet.
15. 7Th packet will be retransmitted from transmitter.
16. Retransmitted 7th packet will be received correctly this time.
17. Select ACK LOST error and click on Generate button in the transmitter window when say
23rd packet is in the transmission state.
18. You will see that 23rd packet in the receiver window will be marked as unacknowledged.
19. 23rd packet will be retransmitted from transmitter.
Retransmitted 23rd packet will be received correctly this time.
20. Select AUTO ERROR and click on Generate button in the transmitter
Window at any packet is in the transmission state, errors are generated at random intervals
and no other error insertion facility will be available to user.
21. Status of packets received when auto error is selected.

Page 7 of 62
22. File transfer from one computer to another will take place.
23. Multiple file transfer between various server-client combinations should be performed to
observe throughput v/s packet size graph on transmitter computer.
24. Close file transfer window and click on protocol analyzer and Network analyzer buttons
on transmitter computer to view details of the log created.
25. Under Network analyzer window click on Graph analyzer button.
26. Calculate throughput and click on Plot graph button.
27. Detailed graph of throughput v/s packet size for the total file transfer activity wil appear
on graph window.
28. This plot can be printed by clicking on print button.

OUPUT:

Page 8 of 62
Page 9 of 62
Page 10 of 62
Page 11 of 62
Page 12 of 62
Page 13 of 62
RESULT:
Thus the Stop & Wait protocol using parallel port & LAN port interface was implemented
and studied by using L-sim simulation software.

Page 14 of 62
Ex. No : 3 Implementation and Study of Goback-N and Selective Repeat Protocols

AIM:
To study and implement an GoBack N protocol and Selective Repeat Protocol using LAN
port interface.

APPARATUS REQUIRED:
• LTS-01 trainer kit.
• 2 Computers with win-2K / XP and Ethernet port available on them.
• RJ-45 to RJ-45 LAN connecting cables.
• L-SIM LAN protocol analyzer and simulator software

PROCEDURE:
Goback-N Protocol:
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.
10. 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. During file transfer process you can insert errors into data packets being transmitted
through software window.
13. See the effect of Bad packet error, Packet negative acknowledgment error or auto errors
on file transfer; observe carefully which packet/packets are transmitted.
14. Select BAD PACKET error and click on Generate button in the transmitter window when
say 15th packet is in the transmission state.
15. You will see that 15th packet in the receiver window will be marked as bad packet.
16. 15th, 16th & 17th packets will be retransmitted from transmitter.
17. 15Th, 16th & 17th packets will be retransmitted from transmitter.
18. Retransmitted 15th, 16th & 17th packets will be received correctly this time, receiver
will discard 16th & 17th packets and only 15th packet is accepted.
19. Select ACK LOST error and click on Generate button in the transmitter window when say
21st packet is in the transmission state.
20. You will see that 21st packet in the receiver window will be marked as
unacknowledged.
21. 21st, 22nd & 23rd packets will be retransmitted from transmitter.
22. Retransmitted 21st, 22nd & 23rd packets will be received and discarded by receiver as
they were received correctly earlier.
23. Select AUTO ERROR and click on Generate button in the transmitter.

Page 15 of 62
Window at any packet is in the transmission state, errors are generated at random intervals
and no other error insertion facility will be available to user.
24. Status of packets received when auto error is selected.
25. File transfer from one computer to another will take place.
26. Multiple file transfer between various server-client combinations should be performed to
observe throughput v/s packet size graph on transmitter computer.
27. Close file transfer window and click on protocol analyzer and Network analyzer buttons
on transmitter computer to view details of the log created.
28. Under Network analyzer window click on Graph analyzer button.
29. Calculate throughput and click on Plot graph button.
30. Detailed graph of throughput v/s packet size for the total file transfer activity will appear
on graph window.

OUTPUT:

Page 16 of 62
Page 17 of 62
Page 18 of 62
Page 19 of 62
Page 20 of 62
Page 21 of 62
Page 22 of 62
SELECTIVE REPEAT PROTOCOL
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 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.
10. 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.
Transmission started screen in transmitter clearly show window size of 3 with 3 packets are
transmitted at a time. Transmission started screen in receiver
12. During file transfer process you can insert errors into data packets being transmitted
through software window.
13. See the effect of Bad packet error, Packet negative acknowledgment error or auto errors
on file transfer; observe carefully which packet/packets are transmitted.
14. Select BAD PACKET error and click on Generate button in the transmitter window when
say 13th packet is in the transmission state.
15. You will see that 13th packet in the receiver window will be marked as bad packet.
16. 13th packet will be retransmitted from transmitter.
17. Retransmitted 13Th packet will be received correctly this time.
18. Select ACK LOST error and click on Generate button in the transmitter window when say
26th packet is in the transmission state.
19. You will see that 26Th packet in the receiver window will be marked as

Page 23 of 62
unacknowledged.
20. 26th packet will be retransmitted from transmitter.

OUTPUT:

Page 24 of 62
Page 25 of 62
Page 26 of 62
Page 27 of 62
Page 28 of 62
Page 29 of 62
RESULT:
Thus the GO-BACK-N and Selective Repeat protocol using parallel port & LAN port
interface was studied and implemented by using L-sim software.

Page 30 of 62
Ex. No : 4 Implementation of High Level Data Link Control

AIM:
To study and Implementation of Wireless LAN.
APPARATUS REQUIRED:
• 3 or 4 Computers with win-2K / XP
• Access point with accessories
• Wireless LAN Access cards with USB driver installed on respective computers
• L-SIM LAN protocol analyzer and simulator software

PROCEDURE:
1. Connect Access point to power outlet and switch it on.
2. Connect USB wireless access cards to computer USB ports and check for driver installed
on respective computers.
3. See appendix for installation guide of LAN access cards.
4. You will find wireless LAN detection on your computers, Assign IP address to the
detected wireless LAN and connect it. Connection of wireless LAN will be indicated on your
computers.
5. Run L-SIM software on all the computers, one should be server and others should be
clients.
6. On the server computer select type of network as WLAN.
7. On the server computer select the topology as STAR, select protocol as CSMA-CA click
on create network button.
8. 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.
9. Click on the Send RTS button to get your computer into transmitter mode.
10. 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.
11. File size will appear in the software window, select the packet size, inter packet delay and
click OK.
12. 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.
13. Click on file transfer button to transfer file.

Page 31 of 62
14. 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.
15. Thus collision of two packets transmitted simultaneously from two senders is avoided.
16. File transfer from one computer to another will take place.
17. Multiple file transfer between various server-client combinations should be performed to
observe throughput v/s packet size graph on transmitter computer.
18. Close file transfer window and click on protocol analyzer and Network analyzer buttons
on transmitter computer to view details of the log created.
19. Under Network analyzer window click on Graph analyzer button.
20. Calculate throughput and click on Plot graph button.
21. Detailed graph of throughput v/s packet size for the total file transfer activity will
appear on graph window.
22. This plot can be printed by clicking on print button.

OUTPUT:

Page 32 of 62
Page 33 of 62
RESULT:
Thus the study and Implementation of Wireless Local Area Network. Was implemented and
verified.

Page 34 of 62
Ex. No : 5 Implementation of IP Commands such as ping, Traceroute, nslookup

AIM:
To write a program for ping,Traceroute,nslookup commands using socket programming.

PROGRAM:
EchoClient.c
#include<stdio.h>
#include<stdlib.h>
#include<errno.h>
#include<string.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<sys/un.h>
#include<arpa/inet.h>
#include<netinet/in.h>
#define SOCK_PATH "echo_socket"
int main(void)
{
int s1,t,len;
struct sockaddr_un remote;
char str[100];
if((s1=socket(AF_UNIX,SOCK_STREAM,0))==-1)
{
printf("socket\n");
exit(1);
}
printf("Trying to connect\n");
remote.sun_family=AF_UNIX;
strcpy(remote.sun_path,SOCK_PATH);

len=strlen(remote.sun_path)+sizeof(remote.sun_family);
if(connect(s1,(struct sockaddr*)&remote,len)==-1)
{
perror("connect");
exit(1);
}
printf("Connectd\n");
while(printf("->"),fgets(str,100,stdin),!feof(stdin))
{
if(send(s1,str,strlen(str),0)==-1)
{
perror("send");
exit(1);
}
if((t=recv(s1,str,100,0))>0)
{
str[t]='\0';
printf(" echo->%s",str);
}
else
{
if(t<0)

Page 35 of 62
perror("recv");
else
printf("server closed connection\n");
exit(1);
}
}
close(s1);
return 0;
}
//EchoServer.c
#include<stdio.h>
#include<stdlib.h>
#include<errno.h>
#include<string.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<sys/un.h>
#include<netinet/in.h>
#include<arpa/inet.h>
#define SOCK_PATH "echo_socket"
int main(void)
{
int s1,s2,len;
struct sockaddr_un local;
struct sockaddr_un remote;
char str[100];
if((s1=socket(AF_UNIX,SOCK_STREAM,0))==-1)
{
printf("socket\n");
exit(1);
}
local.sun_family=AF_UNIX;
strcpy(local.sun_path,SOCK_PATH);
unlink(local.sun_path);
len=strlen(local.sun_path)+sizeof(local.sun_family);
if(bind(s1,(struct sockaddr*)&local,len)==-1)
{
printf("Bind");
exit(1);
}
if(listen(s1,5)==-1)
{
printf("listen");
exit(1);
}
for(;;)
{
int done,n,t;
printf("Waiting for connection\n");
t=sizeof(remote);
if((s2=accept(s1,(struct sockaddr*)&remote,&t))==-1)
{
perror("accept");

Page 36 of 62
exit(1);
}
printf("Connected\n");
done=0;
do
{
n=recv(s2,str,100,0);
if(n<=0)
{
if(n<0)
perror("recv");
done=1;
}
if(!done)
if(send(s2,str,n,0)<0)
{
perror("send");
done=1;
}
}
while(!done);
close(s2);
}
return 0;
}

OUTPUT :
[exam01@localhost ~]$ cc EchoServer.c
EchoServer.c: In function ΓÇÿmainΓÇÖ:
EchoServer.c:41: warning: pointer targets in passing argument 3 of ΓÇÿacceptΓÇ
differ in signedness
[exam01@localhost ~]$ ./a.out 172.16.0.143
Waiting for connection
Connected

OUTPUT :
[exam01@localhost ~]$ cc EchoClient.c
[exam01@localhost ~]$ cc EchoClient.c
[exam01@localhost ~]$ ./a.out 172.16.0.143
Trying to connect
Connectd
->hiii
echo->hiii
->what u want?
echo->what u want?
->india is my country
echo->india is my country
->

RESULT:
Thus the Socket Program for Echo,Traceroute,nslookup Commands are Successfully
Verified.

Page 37 of 62
Ex. No : 6 Implementation of IP address configuration

AIM:
To study and implementation of socket programming and client-server model.
PROGRAM:
//SERVER
import java.net.*;
import java.io.*;
import java.util.*;
class tcpdateserver
{
public static void main(String arg[])
{
ServerSocket ss = null;
Socket cs; PrintStream ps;
BufferedReader dis;
String inet; try
{
ss = new ServerSocket(4444);
System.out.println("Press Ctrl+C to quit"); while(true)
{
cs = ss.accept();
ps = new PrintStream(cs.getOutputStream());
Date d = new Date() ;
ps.println(d);
dis = new BufferedReader(new InputStreamReader(cs.getInputStream()));
inet = dis.readLine(); System.out.println("Client System/IP address is :"+ inet);
ps.close(); dis.close();
}
}
catch(IOException e)
{ System.out.println("The exception is :" + e);
}
}
}
// CLIENT
import java.net.*;
import java.io.*;
class tcpdateclient
{
public static void main (String args[])
{ Socket soc; BufferedReader dis;
String sdate; PrintStream ps;
try { InetAddress ia = InetAddress.getLocalHost();
if (args.length == 0)
soc = new Socket(InetAddress.getLocalHost(),4444);
else soc = new Socket(InetAddress.getByName(args[0]),4444);
dis = new BufferedReader(new InputStreamReader(soc.getInputStream()));
sdate=dis.readLine(); System.out.println("The date/time on server is : " +sdate);
ps = new PrintStream(soc.getOutputStream());

Page 38 of 62
ps.println(ia);
ps.close();
catch(IOException e)
{
System.out.println("THE EXCEPTION is :" + e);
}
}
}
OUTPUT

//SERVER
C:\Documents and Settings\ADMIN>cd C:\Java\jdk1.6.0_02\bin
C:\Java\jdk1.6.0_02\bin>javac tcpdateserver.java
C:\Java\jdk1.6.0_02\bin>java tcpdateserver
Press Ctrl+C to quit
Client System/IP address is :SYSTEM-35/192.168.1.45
//CLIENT
C:\Documents and Settings\ADMIN>cd C:\Java\jdk1.6.0_02\bin
C:\Java\jdk1.6.0_02\bin>javac tcpdateclient.java
C:\Java\jdk1.6.0_02\bin>java tcpdateclient
The date/time on server is : Thu Mar 12 10:54:41 IST 2015
C:\Java\jdk1.6.0_02\bin>

RESULT
Thus Study Of Socket Programming And Client – Server Model has been studied and
verified by using socket programming.

Page 39 of 62
Ex. No : 7 Performance analysis of CSMA/CA and CSMA/CD Protocols

AIM:
To analysis the Performance of CSMA /CA and CSMA/CD Implementation and
comparison study of CSMA-CD protocol.

APPARATUS REQUIRED:
• LTS-01 trainer kit
• 3 Computers with win-2K / XP and Ethernet port available on them
• RJ-45 to RJ-45 LAN connecting cables
• L-SIM LAN protocol analyzer and simulator software

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 an 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 get
initiated.
12. Once the first sender file reached to server its display is refreshed and server will show
packet status for second sender.
13. Second sender file transfer will also get completed and thus collision of two packets
transmitted simultaneously from two senders is detected and cleared.
14. Multiple file transfer between various server-client combinations should be performed
to observe throughput v/s packet size graph on transmitter computer.
15. Close file transfer window and click on protocol analyzer and Network analyzer
buttons on transmitter computer to view details of the log created.
16. Under Network analyzer window click on Graph analyzer button.
And compare with CSMA /CD
19. 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.
20. Switch on the LTS-01 & Computers.
21. Run L-SIM software on all the computers, one should be server and others should be
clients.
22. On the server computer select type of network as LAN.
23. On the server computer select the topology as STAR, select protocol as CSMA-CA
click on create network button.
24. 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.

Page 40 of 62
25. Click on the Send RTS button to get your computer into transmitter mode.
26. 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.
27. File size will appear in the software window, select the packet size, inter packet delay
and click OK.
28. 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.
29. Click on file transfer button to transfer file.
30. During file transfer process try to get access to transmit file by clicking on Send RTS
button on other computers, you will be prompted with channel is busy message.
31. Thus collision of two packets transmitted simultaneously from two senders is avoided.
32. File transfer from one computer to another will take place.
33. Multiple file transfer between various server-client combinations should be performed
to observe throughput v/s packet size graph on transmitter computer.
34. Close file transfer window and click on protocol analyzer and Network analyzer
buttons on transmitter computer to view details of the log created.
35. Under Network analyzer window click on Graph analyzer button.
36. Calculate throughput and click on Plot graph button.

OUTPUT:

Page 41 of 62
RESULT:
Thus the Performance analysis of CSMA /CA and CSMA/CD Implemented and study studied
by using L-sim software.

Page 42 of 62
Ex. No : 8 Network Topology – Star, Bus, Ring

AIM:
To study and implementation of token bus and token ring protocol.

APPARATUS REQUIRED:
• LTS-01 trainer kit
• 4 or more Computers with win-2K / XP and Ethernet port available on them
• RJ-45 to RJ-45 LAN connecting cables
• L-SIM LAN protocol analyzer and simulator software

Page 43 of 62
PROCEDURE:
A. TOKEN BUS:
1. Connect four or more computer LAN ports using RJ-45 to RJ-45 LAN connecting cables
provided with the system to LTS-01 bus 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
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 BUS, select protocol
6. As Token Bus and select token activation time as desired, click on create network button.
7. 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.
8. 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.

Page 44 of 62
9. 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.
10. File size will appear in the software window, select the packet size, inter packet delay
click OK.
11. 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.
12. Click on file transfer button to transfer file.
13. File transfer from one computer to another will take place.
14. Remove connection of last client and see the effect on file transfer or token transfer. You
will find that token will process till the client who is connected in network.
15. Remove connection of client which is in between the server and last client and see the
effect on file transfer or token transfer. You will find that token will process till the client
who is connected in network from client and will not process from the client got disconnected
from network.

B. TOKEN RING:
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.
9. File size will appear in the software window, select the packet size, inter packet delay and
click OK.

Page 45 of 62
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.

RESULT:
Thus the token bus and token ring protocol was studied and implemented by using L-sim
simulation software.

Page 46 of 62
Ex. No : 9 Implementation of Distance Vector Routing algorithm

AIM:
To implement the distance vector routing algorithm.

APPARATUS REQUIRED:
• 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.
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.
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.
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.
10. Click on the result button to see the parameters for shortest path. Click on graph button to
plot the readings against the various parameters.
11. Click on simulate button to start the algorithm, this will calculate the shortest path and
will be shown on the screen.

OUTPUT :

Page 47 of 62
Page 48 of 62
Page 49 of 62
RESULT:
Thus the Implementation of distance vector routing algorithm was implemented and verified.

Page 50 of 62
Ex. No : 10 Implementation of Link State Routing Algorithm

AIM:
To Implement the link state routing algorithm.

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

PROCEDURE:
1. Run N-SIM software from your computer.
To check working of state routing algorithm in the form of animated representation click on
state routing under routing protocols
2. You can study the working of state routing algorithm through this animated movie.
3. To implement this algorithm click on algorithms under menu and click on state
Routing
4. 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.
5. Click configure button to define the links between pair of routers and define its cost in
kilometers.
6. Once all the possible pairs have been defined click save button to save the
configuration defined by you.
7. 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.
8. 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.
10. Click on simulate button to start the algorithm, this will calculate the shortest path and
will be shown on the screen.
11. Click on the result button to see the parameters for shortest path.
12. Click on graph button to plot the readings against the various parameters.

OUTPUT:

Page 51 of 62
Page 52 of 62
Page 53 of 62
RESULT:
Thus the Implementation of link state routing algorithm was implemented and verified by
using N-sim software.

Page 54 of 62
Ex. No : 11 Study of Network Simulator (NS) and Simulation of Congestion Control
Algorithms using NS

AIM:
To Study of Network simulator (NS).and Simulation of Congestion Control Algorithms using
NS.

INTRODUCTION:
ns (from network simulator) is a name for series of discrete event network simulators,
specifically ns-1, ns-2 and ns-3. All of them are discrete-event network simulator, primarily
used in research and teaching. ns-3 is free software, publicly vailable under the GNU GPLv2
license for research, development, and use.
The goal of the ns-3 project is to create an open simulation environment for networking
research that will be preferred inside the research community It should be aligned with the
simulation needs of modern networking research. It should encourage community
contribution, peer review, and validation of the software.
Since the process of creation of a network simulator that contains a sufficient number of high
quality validated, tested and actively maintained models requires a lot of work, ns-3 project
spreads this workload over a large community of users and developers.
ns-1
The first version of ns, known as ns-1, was developed at VJ,GEEKLIME, Madurai (LBNL)
in the 1995-97 timeframe by Steve McCanne, Sally Floyd, Kevin Fall, and other contributors.
This was known as the LBNL Network Simulator, and derived from an earlier simulator
known as REAL by S. Keshav. The core of the simulator was written in C++, with Tcl-based
scripting of simulation scenarios.[5] Long-running contributions have also come from Sun
Microsystems, the UC Berkeley Daedelus, and Carnegie Mellon Monarch projects.it used.
ns-2
In 1996-97, ns version 2 (ns-2) was initiated based on a refactoring by Steve McCanne. Use
of Tcl was replaced by MIT's Object Tcl (OTcl), an object-oriented dialect Tcl. The core of
ns-2 is also written in C++, but the C++ simulation objects are linked to shadow objects in
OTcl and variables can be linked between both language realms. Simulation scripts are
written in the OTcl language, an extension of the Tcl scripting language.

Presently, ns-2 consists of over 300,000 lines of source code, and there is probably a
comparable amount of contributed code that is not integrated directly into the main
distribution (many forks of ns-2 exist, both maintained and unmaintained). It runs on
GNU/Linux, FreeBSD, Solaris, Mac OS X and Windows versions that support Cygwin. It is
licensed for use under version 2 of the GNU General Public License.
ns-3
A team led by Tom Henderson, George Riley, Sally Floyd, and Sumit Roy, applied for and
received funding from the U.S. National Science Foundation (NSF) to build a replacement
for ns-2, called ns-3. This team collaborated with the Planete project of INRIA at Sophia
Antipolis, with Mathieu Lacage as the software lead, and formed a new open source project.
In the process of developing ns-3, it was decided to completely abandon backward
compatibility with ns-2. The new simulator would be written from scratch, using the C++
programming language. Development of ns-3 began in July 2006. A framework for
generating Python bindings (pybindgen) and use of the Waf build system were contributed by
Gustavo Carneiro. The first release, ns-3.1 was made in June 2008, and afterwards the project
continued making quarterly software releases, and more recently has moved to three releases
per year. ns-3 made its eighteenth release (ns-3.18) in the third quarter of 2013.
Current status of the three versions is:

Page 55 of 62
 ns-1 is no longer developed nor maintained,
 ns-2 build of 2009 is not actively maintained (and is not being accepted for journal

publications)
 ns-3 is actively developed (but not compatible for work done on ns-2).
Design
ns-3 is built using C++ and Python with scripting capability. The ns-3 library is wrapped to
python thanks to the pybindgen library which delegates the parsing of the ns-3 C++ headers
to gccxml and pygccxml to generate automatically the corresponding C++ binding glue.
These automatically-generated C++ files are finally compiled into the ns-3 python module to
allow users to interact with the C++ ns-3 models and core through python scripts. The ns-3
simulator features an integrated attribute-based system to manage default and per-instance
values for simulation parameters. All of the configurable default values for parameters are
managed by this system, integrated with command-line argument processing, Doxygen
documentation, and an XML-based and optional GTK-based configuration subsystem.The
large majority of its users focuses on wireless simulations which involve models for Wi-Fi,
WiMAX, or LTE for layers 1 and 2 and routing protocols such as OLSR and AODV.
Components
ns-3 is split over couple dozen modules containing one or more models for real-world
network devices and protocols.ns-3 has more recently integrated with related projects: the
Direct Code Execution extensions allowing the use of C or C++-based applications and Linux
kernel code in the simulations.
Simulation workflow
The general process of creating a simulation can be divided into several steps:
1. Topology definition: to ease the creation of basic facilities and define their
interrelationships, ns-3 has a system of containers and helpers that facilitates this
process.
2. Model development: models are added to simulation (for example, UDP, IPv4, pointto-
point devices and links, applications); most of the time this is done using helpers.
3. Node and link configuration: models set their default values (for example, the size of
packets sent by an application or MTU of a point-to-point link); most of the time this
is done using the attribute system.
4. Execution: simulation facilities generate events, data requested by the user is logged.
5. Performance analysis: after the simulation is finished and data is available as a time
stamped event trace. This data can then be statistically analysed with tools like R to
draw conclusions.
6. Graphical Visualization: raw or processed data collected in a simulation can be
graphed using tools like Gnuplot, matplotlib or XGRAPH.

Examples of network simulators


There are many both free/open-source and proprietary network simulators. Examples
of notable network simulation software are, ordered after how often they are mentioned in
research papers:
1. ns (open source)
2. OPNET (proprietary software)
3. NetSim (proprietary software)
Uses of network simulators
Network simulators serve a variety of needs. Compared to the cost and time involved in
setting up an entire test bed containing multiple networked computers, routers and data
links, network simulators are relatively fast and inexpensive. They allow engineers,
researchers to test scenarios that might be particularly difficult or expensive to emulate using
real hardware - for instance, simulating a scenario with several nodes or experimenting with a
new protocol in the network. Network simulators are particularly useful in allowing

Page 56 of 62
researchers to test new networking protocols or changes to existing protocols in a controlled
and reproducible environment. A typical network simulator encompasses a wide range of
networking technologies and can help the users to build complex networks from basic
building blocks such as a variety of nodes and links. With the help of simulators, one can
design hierarchical networks using various types of nodes like computers, hubs, bridges,
routers, switches, links, mobile units etc.
Various types of Wide Area Network (WAN) technologies like TCP, ATM, IP etc. and
Local Area Network (LAN) technologies like Ethernet, token rings etc., can all be simulated
with a typical simulator and the user can test, analyze various standard results apart from
devising some novel protocol or strategy for routing etc. Network simulators are also widely
used to simulate battlefield networks in Network-centric warfare.
Packet loss
when one or more packets of data travelling across a computer network fail to reach their
destination. Packet loss is distinguished as one of the three main error types encountered in
digital communications; the other two being bit error and spurious packets caused due to
noise.
Packets can be lost in a network because they may be dropped when a queue in the network
node overflows. The amount of packet loss during the steady state is another important
property of a congestion control scheme. The larger the value of packet loss, the more
difficult.
it is for transport layer protocols to maintain high bandwidths, the sensitivity to loss of
individual packets, as well as to frequency and patterns of loss among longer packet
sequences is strongly dependent on the application itself.
Throughput
This is the main performance measure characteristic, and most widely used. In
communication networks, such as Ethernet or packet radio, throughput or network throughput
is the average rate of successful message delivery over a communication channel. The
throughput is usually measured in bits per second (bit/s or bps), and sometimes in data
packets
per second or data packets per time slot This measure how soon the receiver is able to get a
certain amount of data send by the sender. It is determined as the ratio of the total data
received to the end to end delay. Throughput is an important factor which directly impacts the
network performance.
Delay
Delay is the time elapsed while a packet travels from one point e.g., source premise or
network ingress to destination premise or network degrees. The larger the valueof delay, the
more difficult it is for transport layer protocols to maintain high bandwidths. We will
calculate end to end delay.
Queue Length
A queuing system in networks can be described as packets arriving for service, waiting
for service if it is not immediate, and if having waited for service, leaving the system after
being served. Thus queue length is very important characteristic to determine that how well
the active queue management of the congestion control algorithm has been working.

RESULT
Thus the study of Network simulator (NS) was studied.

Page 57 of 62
Ex. No : 12 Implementation of Data Encryption and Decryption Algorithms

AIM:
To Study and implementation of data encryption and decryption.

APPARATUS REQUIRED:
• LTS-01 trainer kit
• 2 Computers with win-2K / XP and Ethernet port available on them
• RJ-45 to RJ-45 LAN connecting cables
• L-SIM LAN protocol analyzer and simulator software

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.
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.
12. You will see actual file selected packet 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. Visual help showing decryption procedure.
16. You can resume file transfer by clicking on continue button.
17. Encrypted format of each packet can thus be seen by pausing the file transfer at
respective packet when it is under transmission state.
18. File transfer from one computer to another will take place.
19. To study programming of Cryptography with Encryption and Decryption process
sample executable file & program is provided inside program files – Lsim –
SampleApplication.zip.
20. When user extracts this folder he will find cryptography folder inside which

Page 58 of 62
cryptography.cpp & cryptography.exe files are provided.
21. If user runs the cryptography.exe file screen with browse option for selection of file to
be encrypted and enter key for encryption option will get open for user to select the
file and enter encryption key.
22. When user clicks on Encrypt button a message with Encryption completed
Will popup. Encrypted file will be stored at the same location from where file for
encryption is selected.
23. User has to select file to be decrypted and enter decryption key.
24. When user clicks on Decrypt button a message with Decryption completed
Will popup. Decrypted file will be stored at the same location from where file for
decryption is selected.
25. To verify encryption and decrypted files user has to close the cryptography.exe file.
26. Actual programming can be checked from cryptography.cpp program.

OUTPUT:

Page 59 of 62
Page 60 of 62
Page 61 of 62
RESULT:
Thus the data encryption and decryption was studied and implemented by using L-sim
software.

Page 62 of 62

You might also like