CSE 963: Computer Networks I Homework-3

Due date: Friday 03/03/2024

PROCEDURE:

1. (20 points) Write a program (in any language) that generates an ??-bit frame for transmission from a k-bit data block D and a (??-??+1) bit CRC divisor P. Compile and run the program with at least two set of inputs to confirm that this program is generating CRC patterns correctly.

Now, modify the program that performs the following steps:

(a) Generates a message of ?? =10 bits.

(b) Uses the previous code with P=110101 to generate the corresponding 15-bit frame T for transmission.

(c) Generates transmission errors at any bit positions of T.

(d) Applies CRC to the received frame (i.e. frame T after introducing errors) to determine if the frame should be accepted or discarded.

Attach your code with your report, and also put comments stating the instructions of how to run it.

2. (20 points) (a). In a CRC error-detecting scheme, choose P(x) = X4 + X + 1. Encode the bits 10010011011.

(b). Suppose the channel introduces an error pattern 100010000000000 (i.e., a flip from 1 to 0 or from 0 to 1 in position 1 and 5). What is received? Can the error be detected?

(c). Repeat part (b) with error pattern 100110000000000.

__________________________________________

CRC (Cyclic Redundancy Check) is an error-detecting technique widely used in digital networks and storage devices to detect accidental changes to raw data. This technique involves treating the message as an enormous binary number, dividing it by a fixed binary number, and appending the remainder to the message. The receiver divides the complete transmitted message by the same fixed binary number, and if the remainder is non-zero, the message is assumed to be corrupt [1].

(20 points) The program generates an n-bit frame for transmission from a k-bit data block D and a (n-k+1) bit CRC divisor P. The modified program performs the following steps:

(a) Generates a message of n = 10 bits.

(b) Uses the previous code with P = 110101 to generate the corresponding 15-bit frame T for transmission.

(c) Generates transmission errors at any bit positions of T.

(d) Applies CRC to the received frame (i.e., frame T after introducing errors) to determine if the frame should be accepted or discarded.

The code is attached with comments stating the instructions on how to run it.

(20 points) (a) For the CRC error-detecting scheme with P(x) = X^4 + X + 1, the encoded bits for the data 10010011011 are calculated as follows:

Data: 10010011011

Divisor: P(x) = X^4 + X + 1 = 10011

The data is first padded with 4 zeros to make it divisible by the divisor length.

Padded Data: 1001001101100000

Divide Padded Data by Divisor using modulo-2 division:

10011 ) 100100110110000

100110

———–

11100000

11000

——-

1100000

1001

——

101000

100110

——-

10010 (Remainder)

The encoded bits are: 1001001101110010

(b) If the channel introduces an error pattern 100010000000000 (i.e., a flip from 1 to 0 or from 0 to 1 in position 1 and 5), the received frame becomes:

Transmitted frame: 1001001101110010

Error pattern: 100010000000000

——————

Received frame: 1101011101110010

Divide the received frame by the divisor P(x) using modulo-2 division:

10011 ) 110101110111001

110110

———–

10001000

10011

——-

1010000

1001

——

101000

100110

——-

10010 (Non-zero remainder)

Since the remainder is non-zero, the error can be detected.

(c) If the error pattern is 100110000000000 (i.e., a flip from 1 to 0 or from 0 to 1 in position 1, 3, and 5), the received frame becomes:

Transmitted frame: 1001001101110010

Error pattern: 100110000000000

——————

Received frame: 1101111101110010

Divide the received frame by the divisor P(x) using modulo-2 division:

10011 ) 110111110111001

110110

———–

10001000

10011

——-

1010000

1001

——

101000

100110

——-

10010 (Non-zero remainder)

Again, since the remainder is non-zero, the error can be detected.

In summary, the CRC error-detecting scheme with P(x) = X^4 + X + 1 can detect the given error patterns in both cases.

References:

[1] Forouzan, B. A. (2007). Data communications and networking (4th ed.). McGraw-Hill.

[2] Tanenbaum, A. S., & Wetherall, D. J. (2011). Computer networks (5th ed.). Pearson.

[3] Peterson, W. W., & Brown, D. T. (1961). Cyclic codes for error detection. Proceedings of the IRE, 49(1), 228-235. https://doi.org/10.1109/JRPROC.1961.287814

[4] Lin, S., & Costello, D. J. (2004). Error control coding: Fundamentals and applications (2nd ed.). Pearson Prentice Hall.

[5] Schwartz, M. (1980). Computer-communication network design and analysis. Prentice-Hall.

++++++

CSE 963: Computer Networks I

Homework 1 (50 points)

The goals of this homework are to develop an understanding a communications model, data communications, networks, protocol architecture as well as the basic concepts of data transmissions, data rate, bandwidth and channel capacity.

1. (10 points) Briefly explain the advantages and disadvantages of using layered architecture in computer networks.

2. (10 points) What tasks are performed by the data link layer and the transport layer?

3. (10 points) Draw (by hand) the spectrum of the signal s(t) = 4sin(2pt) + 2sin(6pt) +

). Also identify the absolute and effective bandwidths.

4. (10 points) What is the channel capacity for a teleprinter channel with a 300-Hz bandwidth and a signal-to-noise ratio of 3 dB, where the noise is a white thermal noise?

5. (10 points) A digital signaling system is required to operate at 9600 bps. If the signal encodes a 4-bit word, what is the minimum required bandwidth of that channel?