Sunteți pe pagina 1din 12

G.H.

PATEL COLLEGE OF ENGINEERING AND TECHNOLOGY,


V.V.NAGAR
Department of Electronics and Communication Engineering

EXPERIMENT 4
AIM: To write a MATLAB code for cyclic redundancy check (CRC) algorithm.
CODE:
clc;
clear all;
close all;
x=[1 1 1 0 1 1 0 1];
y=input('divisor=');
z=size(y);
a=padarray(x,z-1,'post')
b=bi2de(a);
c=bi2de(y);
d=mod(b,c);
e=de2bi(d);
f1=size(a);
f2=size(e);
s=f1-f2;
g=padarray(e,s,'pre');
h=a+g
h1=bi2de(h);

OUTPUT:
Enter the data.[1 0 1 0 1 0 1 0]
Enter the generator matrix.[1 0 1 1 1]
transmitted =
0 1 0 1 1 1 0 0
received =
0

0 0

CONCLUSION:

15
DATA COMMUNICATION AND NETWORKING (181001)

G.H.PATEL COLLEGE OF ENGINEERING AND TECHNOLOGY,


V.V.NAGAR
Department of Electronics and Communication Engineering

PRACTICAL: 5
PART: A
Aim: Implementation of PC to PC with LAN trainer kit.
Procedure :
1. Connect CAT5 cables between computer (RJ-45 is on back panel of
the computer) and RJ-45 connectors on trainer.
2.

Connect patch cords between Tx & Rx (Tx+ to Rx+; Tx- to Rx-) for both ends.

3.

Run ST5002 installed software on both nodes and follow the steps

4. A window will appear on screen as shown in figure below :

16
DATA COMMUNICATION AND NETWORKING (181001)

G.H.PATEL COLLEGE OF ENGINEERING AND TECHNOLOGY,


V.V.NAGAR
Department of Electronics and Communication Engineering
6.

Select Server on PC1

7.

Enter the IP Address of PC1 into Client Textbox of PC2

8.
9.

Now you can have a chat application between server and client.
Enter data here and press Enter or click on Send Data

CONCLUSION:

17
DATA COMMUNICATION AND NETWORKING (181001)

G.H.PATEL COLLEGE OF ENGINEERING AND TECHNOLOGY,


V.V.NAGAR
Department of Electronics and Communication Engineering
PART: B Aim: Study of Token Bus Protocol using LAN Trainer Kit
Procedure :
1.

Connect nodes to bus topology section on ST5002 trainer.

2.

Connect End Terminators

3. Please check whether the SPX/IPX Protocol is installed on all the systems before
performing experiment. (Refer How to Install SPX/IPX protocol)
4. Open ST5002 Software.
5. Click on Bus Topology.

6. A window will appear on your screen as shown in figure below :

7. Make one node as server by pressing Server button.

8. On the other nodes you have to connect to server by pressing Connect to Network.
18
DATA COMMUNICATION AND NETWORKING (181001)

G.H.PATEL COLLEGE OF ENGINEERING AND TECHNOLOGY,


V.V.NAGAR
Department of Electronics and Communication Engineering

9. You will see transmission status as shown

CONCLUSION:

19
DATA COMMUNICATION AND NETWORKING (181001)

G.H.PATEL COLLEGE OF ENGINEERING AND TECHNOLOGY,


V.V.NAGAR
Department of Electronics and Communication Engineering

PRACTICAL: 6
Aim: To implement different Topologies using LAN Trainer Kit (ST 5002).
Apparatus: ST 5002 Trainer Kit, ST 5002 software, 11 patch cords(2mm), 2 parallel port
cables, mains power cord.
Diagram:

Features of LAN Trainer Kit-:


1.) PC to PC communication with IEEE 802.3
2.) Peer to Peer network
3.) Client - Server network
4.) Design of Star topology using 100Base-Tx
5.) Design of Bus topology using 10Base-2
6.) Design of Ring topology using DB9
7.) Simulation of Distance Vectors and Link State Algorithms
8.) Socket Programming exercise for LINUX
9.) Encryption/Decryption Technique
10.) User can send any file over LAN.
11.) Detailed introduction to TCP/IP Model (4 Layer Model)
12.) Video Tutorials for software operation
13.) Creation of cables for network connections
14.) Network design using RJ45 & DB9 connectors
16.) Socket programming and processing
17.) Wireless LAN with 803.11b/g
18.) Network monitoring
19.) Various LAN Protocols
20
DATA COMMUNICATION AND NETWORKING (181001)

G.H.PATEL COLLEGE OF ENGINEERING AND TECHNOLOGY,


V.V.NAGAR
Department of Electronics and Communication Engineering
20.) Data rate up to 100Mbps
21.) Variable packet size
22.) Variable packet delay
23.) Error generation (Manual and Auto)
24.) Color coded real time graphical representation of entire transmission & reception
25.) Graphical Analysis of LAN performance with various parameters and protocols
26.) Save / Print option for graphs
27.) User friendly software
28.) Switch faults in both hardware & software
29.) Exhaustive course material & references
30.) On Board Touch Switch
Procedure -:
1.) Connect mains power cord to the trainer and switch on the trainer.
2.) Connect the parallel port cables to node 1 & node 2 both.
3.) To open the window, follow the steps. Run ST 5002 software on both the
PCs. Click parallel port interface image/press Ctrl + P/click Options on menu
bar.
4.) The very first step is to select the port address of parallel port .Choose one option from
given three options.
5.) Generally the address is 378, so the window will open with this option selected.
6.) To send data to other node enter the text in the window titled as Enter data to Transmit.
Click on Send button to transmit.
7.) Transmitted data will be displayed in the Received Data window and the ASCII codes of
each byte received is displayed in Received Data in ASCII window.
8.) A small window at sender side is given for Transmission of ASCII code.
Enter the ASCII code in window and then click Send button.
9.) Clear buttons are given to clear all windows.
CONCLUSION:

21
DATA COMMUNICATION AND NETWORKING (181001)

G.H.PATEL COLLEGE OF ENGINEERING AND TECHNOLOGY,


V.V.NAGAR
Department of Electronics and Communication Engineering

EXPERIMENT 7
AIM: To implement cipher key algorithm using MATLAB.
CODE:
a=input('message=','s');
k=input('shiftkey=');
b=double(a)
f1=b+k;
m=size(f1);
for i=1:m(2)
if f1(i)>122
f1(i)=96+(f1(i)-122);
end
end
c=char(f1)
OUTPUT:
message=abcd
shiftkey=3
b=
97

98

99 100

c = defg
CONCLUSION:

22
DATA COMMUNICATION AND NETWORKING (181001)

G.H.PATEL COLLEGE OF ENGINEERING AND TECHNOLOGY,


V.V.NAGAR
Department of Electronics and Communication Engineering

EXPERIMENT 8
AIM: To implement hamming code using MATLAB
CODE:
clc;
close all;
clear all;
tic
y=0;
p=1;
m=input('message signal');
% m=[1 1 1 1 1 1 1 1];
m1=size(m);
m1=max(m1);
for r=1:10
if ((m1+1+r)>(2^r))
p=p+1;
end
end
s=zeros(1,2^p);
z=1;
d=1;
for i=1:m1+p
if i==2^(d-1)
s(i)=0;
d=d+1;
else
s(i)=m(z);
z=z+1;
end
end
for i=1:p
u=i-1;
f=2^u; %add 1 skip one
for j=f:2*f:m1+p
for g=j:j+f-1 %add consecutive
y=y +s(g);
end
end
if mod(y,2)==0
s(f)=0;
else
s(f)=1;
23
DATA COMMUNICATION AND NETWORKING (181001)

G.H.PATEL COLLEGE OF ENGINEERING AND TECHNOLOGY,


V.V.NAGAR
Department of Electronics and Communication Engineering
end
y=0;
end
for i=1:m1+p
t(i)=s(i);
end

OUTPUT:
message signal[1 0 1 0 1 0 1 0]

t=

CONCLUSION:

24
DATA COMMUNICATION AND NETWORKING (181001)

G.H.PATEL COLLEGE OF ENGINEERING AND TECHNOLOGY,


V.V.NAGAR
Department of Electronics and Communication Engineering

PRACTICAL: 9
AIM: Introduction to NS-2 Software. (Complex Lab problem)
THEORY:
Introduction:
NS (version 2) is an object-oriented, discrete event driven network simulator developed at
UC Berkely written in C++ and OTcl. NS is primarily useful for simulating local and wide
area networks. It implements network protocols such as TCP and UPD, traffic source
behavior such as FTP, Telnet, Web, CBR and VBR, router queue management mechanism
such as Drop Tail, RED and CBQ, routing algorithms such as Dijkstra, and more.
Simulation Example:
This section shows a simple NS simulation script and explains what each line does.
This network consists of 4 nodes (n0, n1, n2, n3) as shown in above figure. The duplex links
between n0 and n2, and n1 and n2 have 2 Mbps of bandwidth and 10 ms of delay. The duplex
link between n2 and n3 has 1.7 Mbps of bandwidth and 20 ms of delay. Each node uses a
DropTail queue, of which the maximum size is 10. A "tcp" agent is attached to n0, and a
connection is established to a tcp "sink" agent attached to n3. As default, the maximum size of
a packet that a "tcp" agent can generate is 1KByte. A tcp "sink" agent generates and sends ACK
packets to the sender (tcp agent) and frees the received packets. A "udp" agent that is attached
to n1 is connected to a "null" agent attached to n3. A "null" agent just frees the packets received.
A "ftp" and a "cbr" traffic generator are attached to "tcp" and "udp" agents respectively, and
the "cbr" is configured to generate 1 KByte packets at the rate of 1 Mbps. The "cbr" is set to
start at 0.1 sec and stop at 4.5 sec, and "ftp" is set to start at 1.0 sec and stop at 4.0 sec.

25
DATA COMMUNICATION AND NETWORKING (181001)

G.H.PATEL COLLEGE OF ENGINEERING AND TECHNOLOGY,


V.V.NAGAR
Department of Electronics and Communication Engineering

Trace Analysis Example:


Here, there is a trace analysis example.

CONCLUSION:

26
DATA COMMUNICATION AND NETWORKING (181001)

S-ar putea să vă placă și