0% found this document useful (0 votes)
2 views

NS Lab Output (Single Side Printout)

The document outlines a series of experiments related to data communication protocols, including bit and character stuffing, error detection methods like CRC and LRC, and various routing algorithms. It also covers data encryption and decryption using DES and RSA algorithms, along with client-server models using FTP. Additionally, it describes different network topologies such as star, bus, and ring.

Uploaded by

jonesab0717
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

NS Lab Output (Single Side Printout)

The document outlines a series of experiments related to data communication protocols, including bit and character stuffing, error detection methods like CRC and LRC, and various routing algorithms. It also covers data encryption and decryption using DES and RSA algorithms, along with client-server models using FTP. Additionally, it describes different network topologies such as star, bus, and ring.

Uploaded by

jonesab0717
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Experiment No.

: 1
Bit stuffing:

Character stuffing:

OUTPUT OF CHARACTER STUFFING


Enter characters to be stuffed: COLLAGE
Enter a character that represents starting delimiter : E
Enter a character that represents ending delimiter : G
After stuffing: ECOLLAGGEEG
Experiment No.: 2a

a) Longitudinal Redundancy Check (LRC):


Experiment No.: 2b

b) Cyclic Redundancy Check (CRC):

Enter data to be transmitted: 1001101


Enter the Generating polynomial: 0101
----------------------------------------
Data padded with n-1 zeros : 1001101000
----------------------------------------
CRC or Check value is : 100
----------------------------------------
Final data to be sent : 1001101100
----------------------------------------
Enter the received data: 1001101100
-----------------------------
Data received: 1001101100
No error detected - CRC
Experiment No.: 2c
(c) Hamming Code:
Experiment No.: 3a
STOP AND WAIT PROTOCAL:

Enter the frame size:20


Enter the window size:5
transmit the window no 1
frame 0 is sent
frame 1 is sent
frame 2 is sent
frame 3 is sent
frame 4 is sent
transmit the window no 2
frame 5 is sent
frame 6 is sent
frame 7 is sent
frame 8 is sent
frame 9 is sent
transmit the window no 3
frame 10 is sent
frame 11 is sent
frame 12 is sent
frame 13 is sent
frame 14 is sent
transmit the window no 4
frame 15 is sent
frame 16 is sent
frame 17 is sent
frame 18 is sent
frame 19 is sent
Experiment No.: 3b
Experiment No.: 4
Go back-N:

1.Selective repeat ARQ


2.Goback ARQ
3.exit
Enter your choice:2
Enter the no. of packets to be sent:3
Enter data for packets[1]6
Enter data for packets[2]7
Enter data for packets[3]8
The packet number 1 is not received
resending from packet 1
Received data of packet 1 is 6
Received data of packet 2 is 7
Received data of packet 3 is 8
all packets sent successfully
Experiment No.: 5

Distance Vector Routing Algorithm output:

Enter the number of nodes : 2


Enter the cost matrix :
12
34
State value for router 1 is

node 1 via 1 Distance0


node 2 via 2 Distance2
State value for router 2 is

node 1 via 1 Distance3


node 2 via 2 Distance0
Experiment No.: 6

Link State Routing algorithm:

Enter the number of routers: 4


Enter the cost matrix values:
0 -> 0: 1 2 3 4
0 -> 1: 0 -> 2: 0 -> 3: 1 -> 0: 5 6 7 8
1 -> 1: 1 -> 2: 1 -> 3: 2 -> 0: 7 8 9 3
2 -> 1: 2 -> 2: 2 -> 3: 3 -> 0: 6 7 5 4
3 -> 1: 3 -> 2: 3 -> 3:
Enter the source router: 3
3 ==> 0: Path taken: 0 <-- 3
Shortest path cost: 6
3 ==> 1: Path taken: 1 <-- 3
Shortest path cost: 7
3 ==> 2: Path taken: 2 <-- 3
Shortest path cost: 5
3 ==> 3: Path taken: 3
Shortest path cost: 4
Experiment No.: 7

Data encryption and decryption using Data Encryption Standard algorithm:

Encrypted output
Please enter a string: happiness
Please choose following options:
1 = Encrypt the string.
2 = Decrypt the string.
1
Encrypted string: kdsslqhvv

Decrypted output
Please enter a string: kdsslqhvv
Please choose following options:
1 = Encrypt the string.
2 = Decrypt the string.
2
Decrypted string: happiness
Experiment No.: 8

Data encryption and decryption using RSA (Rivest, Shamir and Adleman) algorithm:

ENTER FIRST PRIME NUMBER


3
ENTER ANOTHER PRIME NUMBER
5
ENTER MESSAGE
success
POSSIBLE VALUES OF e AND d ARE
7 7
THE ENCRYPTED MESSAGE IS
dflledd
THE DECRYPTED MESSAGE IS
dfccedd
Experiment No.: 9

Client Server model using FTP protocol:

Output
Gcc server.c –o server
Gcc client.c –o client

./server (execute in separate terminal/output window)

./client (execute in separate terminal/output window)


Experiment No.: 10 a

Star Topology:
Experiment No.: 10 b

Bus Topology
Experiment No.: 10 c

Ring Topology
Experiment No.: 11 a

CSMA/CA:
Experiment No.: 11 b

CSMA/CD

You might also like