0% found this document useful (0 votes)
20 views2 pages

VL2023240505851 Ast02

The document outlines 7 assignments for a data communications and networks lab course. The assignments cover topics like parity checking, Hamming distance, cyclic redundancy check (CRC), checksums, Hamming codes, and using TCP and UDP protocols to transfer and convert strings between a client and server.

Uploaded by

Nithin Joel
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)
20 views2 pages

VL2023240505851 Ast02

The document outlines 7 assignments for a data communications and networks lab course. The assignments cover topics like parity checking, Hamming distance, cyclic redundancy check (CRC), checksums, Hamming codes, and using TCP and UDP protocols to transfer and convert strings between a client and server.

Uploaded by

Nithin Joel
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/ 2

ASSIGNMENT 2

CSI2007 – DATA COMMUNICATION AND NETWORKS LAB

WINTER SEMESTER 2023-2024

1. Write a program to check the parity of a given number.


Input : Enter the number : 4
Output : Odd parity
Input : Enter the number : 5
Output : Even parity
2. Write a program to check the hamming distance for the binary encoded codewords and
specify the minimum hamming distance for the same.

Sample Input/Output :

3. Implement forward error detection mechanism using Cyclic Redundancy Check (CRC). Get
the input data from the user for performing CRC. Based on the generator calculate the CRC
bits to be added to the data at sender side. Append the redundant bit with the message. At
the receiver side, check for errors in the message during transmission.

The sample output is as follows:


Sender Side:
Enter the length of the data: 6
Enter the data: 100100
Enter the length of the Generator (Divisor): 4
Enter the Generator (Divisor) : 1101
Number of 0's to be appended: 3
Message after appending 0's :100100000
CRC bits: 001
Transmitted Data: 100100001
Receiver side:
Received Data: 100100001
Remainder: 000
Since remainder is 0, hence the message has received correctly!!!
4. Write a program to implement the Checksum Generator on the Sender side and Checksum
Checker on the Receiver side.
Sample I/P and O/P:
Suppose that the sender wants to.
Input: Sender - 4 frames each of 8 bits, where the frames are 11001100, 10101010,
11110000 and 11000011
Receiver - Receive the same frame along with checksum
Output: No Error
Input: Sender - 4 frames each of 8 bits, where the frames are 11001100, 10101010,
11110000 and 11000011
Receiver the Frame 2 - 11101010
Output: Non Zero checksum and Error.

5. Implement the Hamming code for forward error detection at sender side. Get the input data
from the user between (1 to 15 bits) for calculating the parity bits. Consider even parity is
used here and calculate the parity bits. Generate the code word (Data + Redundancy Bits) by
placing the parity bits in appropriate locations.

The sample output is as follows:


Sender Side:
Enter the length of the data: 7
Enter the data: 1001001

Number of parity bits is: 4


Parity bits are P1 = X, P2 =X, P4 = X and P8= X (Here X could be 0 or 1)
Code word at Sender Site is: 1 0 P1 0 1 0 0 P2 1 P4 P8 (Here X could be 0 or 1)
6. Write a program to transfer a string from client, convert it into uppercase and send it to
client from server using a TCP protocol.
7. Write a program to transfer a string from client, convert it into uppercase and send it to
client from server using a UDP protocol.

You might also like