30
EC 401 Data Communication and Networking CHARUSAT Page 1 of 30 Date: Practical 1: Implement Bit Stuffing Algorithm in MATLAB Objective : To Implement the Bit stuffing algorithm in MATLAB. Program: %This code provides bit stuffing for any input message sequence % %msg=[ 1 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 ] --Unstuffed %msg=[1 0 1 1 1 1 1 0 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 0 1 0] --Stuffed msg=input('Input Message binary bit stream :'); count=0; stuffcount=0 [M N]=size(msg); for j=1:N-5+stuffcount j for i=j:j+5 i if msg(i)==1 count=count+1 else count=0; break; end end if(count ==6) msg=[msg(1:j+4) 0 msg(j+5 : end)] count=0; stuffcount=stuffcount+1 end end msg Conclusion:

Lab Manual dcn

Embed Size (px)

DESCRIPTION

dcn lab manual with practicals

Citation preview

Page 1: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 1 of 30

Date:

Practical 1: Implement Bit Stuffing Algorithm in MATLAB

Objective : To Implement the Bit stuffing algorithm in MATLAB.

Program:

%This code provides bit stuffing for any input message sequence

%

%msg=[ 1 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 ] --Unstuffed

%msg=[1 0 1 1 1 1 1 0 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 0 1 0] --Stuffed

msg=input('Input Message binary bit stream :');

count=0;

stuffcount=0

[M N]=size(msg);

for j=1:N-5+stuffcount

j

for i=j:j+5

i

if msg(i)==1

count=count+1

else

count=0;

break;

end

end

if(count ==6)

msg=[msg(1:j+4) 0 msg(j+5 : end)]

count=0;

stuffcount=stuffcount+1

end

end

msg

Conclusion:

Page 2: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 2 of 30

Date:

Practical 2: Implement the ALOHA protocol for packet communication

Objective : To Implement the ALOHA protocol for packet communication between a

number of nodes

Procedure Steps:

Page 3: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 3 of 30

Page 4: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 4 of 30

Page 5: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 5 of 30

Observation Table:

IPD TX 1 TX 2 TX 3 TX 4

G –

Practical

Offered

Load

X –

Practical

Throughput

Theoretical

Throughput

40

100

4000

Conclusion:

Page 6: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 6 of 30

Date:

Practical 3: Implement the CSMA protocol for packet communication

Objective : To Implement the CSMA protocol for packet communication between a

number of nodes

Procedure Steps:

Page 7: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 7 of 30

Page 8: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 8 of 30

Page 9: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 9 of 30

Observation Table:

IPD TX 1 TX 2 TX 3 TX 4

G –

Practical

Offered

Load

X –

Practical

Throughput

Theoretical

Throughput

40

100

Conclusion:

Page 10: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 10 of 30

Date:

Practical 4: Implement the CSMA/CD protocol for packet communication

Objective : To Implement the CSMA/CD protocol for packet communication between

a number of nodes

Procedure Steps:

Page 11: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 11 of 30

Page 12: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 12 of 30

Page 13: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 13 of 30

Observation Table:

IPD TX 1 TX 2 TX 3 TX 4

G –

Practical

Offered

Load

X –

Practical

Throughput

Theoretical

Throughput

40

100

Conclusion:

Page 14: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 14 of 30

Date:

Practical 5: To implement the token passing access in BUS-LAN

Objective : To Implement the token passing access in BUS-LAN

Procedure Steps:

Page 15: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 15 of 30

Page 16: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 16 of 30

Observation Table:

IPD TX 1 TX 2 TX 3 TX 4

G –

Practical

Offered

Load

X –

Practical

Throughput

Theoretical

Throughput

40

100

Conclusion:

Page 17: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 17 of 30

Date:

Practical 6: Provide reliable data transfer between two nodes over an unreliable

network using the stop and- wait protocol.

Objective : To transfer data between two nodes over an unreliable network using stop

and wait protocol.

Procedure steps:

Page 18: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 18 of 30

Page 19: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 19 of 30

Observation Table:

Time out value in ms Successfully Tx packets Practical Throughput

1000

1500

Conclusion:

Page 20: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 20 of 30

Date:

Practical 7: Provide reliable data transfer between two nodes over an error network

using the stop-and wait protocol.

Objective: To transfer the data between two nodes over an error networking using the

stop and wait protocol.

Procedure Steps:

Page 21: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 21 of 30

Observation Table:

BER Successfully Tx packets Theoretical Throughput Practical Throughput

10-4

Conclusion:

Page 22: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 22 of 30

Date:

Practical 8: To transfer file using file transfer protocol (FTP).

Objective : To transfer the file using file transfer protocol between two nodes.

Procedure Steps:

Page 23: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 23 of 30

Page 24: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 24 of 30

Conclusion:

Page 25: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 25 of 30

Date:

Practical 9: To understand operation of packet tracer software.

Objectives: a. Develop and understanding of basic functions of Packet Tracer

b. Model a simple network and observe traffic behavior on the network

c. Create Simple Ethernet network

Procedure Steps:

Page 26: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 26 of 30

Page 27: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 27 of 30

Page 28: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 28 of 30

Reference: ‘Packet Tracer Interactive Course Guide’, CISCO Learning Institute, 2011

Conclusion:

Page 29: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 29 of 30

Date:

Practical 10: To implement basic network in packet tracer software using static

routing.

Objective : To implement the network shown in diagram and configure the network

using static routing.

Process Steps:

Step 1: Go to router command prompt

Step 2: Configure the interface address given in the schematic

Step 3: Enter static Routing commands at global configuration mode.

Router1

• Router1(config)# ip route 172.16.3.0 255.255.255.0 172.16.2.1

• Router1(config)# ip route 192.168.2.0 255.255.255.0 192.168.1.1

Page 30: Lab Manual dcn

EC 401 Data Communication and Networking CHARUSAT

Page 30 of 30

Router2

• Router2(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.2

• Router2(config)# ip route 192.168.1.0 255.255.255.0 172.16.2.2

• Router2(config)# ip route 192.168.2.0 255.255.255.0 172.16.2.2

Router3

• Router3(config)# ip route 172.16.1.0 255.255.255.0 192.168.1.2

• Router3(config)# ip route 172.16.2.0 255.255.255.0 192.168.1.2

• Router3(config)# ip route 172.16.3.0 255.255.255.0 192.168.1.2

Verify and Validate:

• All hosts and all routers should be able to ping every interface in the network.

• Do a “show running-config” and notice the static routes that you entered.

• Router# show ip route

Conclusion: