Sunteți pe pagina 1din 9

Harsh Thanki

104700978
Computer Networks
thankih@uwindsor.ca

Homework-4

Q.1 Please answer the following questions.

a. Compare byte-stuffing and bit-stuffing. Which


technique is used in byte-oriented protocols? Which technique is
used in bit-oriented protocols?
Byte stuffing is the process of adding 1 extra byte whenever there is a flag or escape character in the
text while bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a 0 in
the data, so that the receiver does not mistake the pattern 0111110 for a flag. Byte stuffing is used at
byte-oriented protocols and bit stuffing is used at bit-oriented protocols.

b. Compare and contrast flow control and error control.

Key Differences Between Flow Control and Error Control

1. Flow control is to monitor the proper transmission of data from sender to receiver. On the
other hand, Error Control monitors the error-free delivery of data from sender to receiver.

2. Flow control can be achieved by the Feedback-based flow control and rate-based flow control
approach whereas, to detect the error the approaches used are Parity checking, Cyclic
Redundancy Code (CRC) and checksum and to correct the error the approaches used are
Hamming code, Binary Convolution codes, Reed-Solomon code, Low-Density Parity Check
codes.

3. Flow control prevents the receivers buffer from overrunning and also prevents the loss of
data. On the other hand, Error control detects and corrects error occurred in the data.

c. Explain the reason for moving from the Stop-and-Wait ARQ protocol to the Go-
Back-N ARQ protocol.

Go back-N ARQ protocol is used to improve the efficiency of transmission of stop-and-wait ARQ
protocol by sending multi frame while waiting for acknowledgement in order to utilize the bandwidth
channel. The way Stop-and-Wait ARQ Protocol work is not fully utilize the bandwidth channel.

d. Define piggybacking and its usefulness.

Piggybacking is used to improve the efficiency of bidirectional transmission. When a frame is carrying
data from A to B, it can also carry control information about frames from B; when a frame is carrying data
from B to A, it can also carry control information about frames from A.
e. Which of the protocols described in lecture notes utilize pipelining?

Go-Back-N ARQ utilizes pipelining.

Q.2 Given the dataword 1010011110 and the divisor 10111


i.Show the generation of the codeword at the sender site (using
binary division).

1 2 3 4 5 6 7 8 9 10 11 12 13 14

M= 1 0 1 0 0 1 1 1 1 0

G=

10111 1 0 1 0 0 1 1 1 1 0 0 0 0 0

1 0 1 1 1

0 0 1 1 1

0 0 0 0 0

0 1 1 1 1

0 0 0 0 0

1 1 1 1 1

1 0 1 1 1

1 0 0 0 1

1 0 1 1 1

0 1 1 0 0

0 0 0 0 0

1 1 0 0 0

1 0 1 1 1

1 1 1 1 0

1 0 1 1 1

1 0 0 1 0

1 0 1 1 1

0 1 0 1 0

0 0 0 0

1 0 1 0

T= 1 0 1 0 0 1 1 1 1 0 1 0 1 0

Original Message CRC Checksum

CRC Checksum was 1010

Codeword was 10100111101010


ii. Show the checking of the codeword at the receiver site
(assuming no errors).

1 2 3 4 5 6 7 8 9 10 11 12 13 14

M= 1 0 1 0 0 1 1 1 1 0

G=

10111 1 0 1 0 0 1 1 1 1 0 1 0 1 0

1 0 1 1 1

0 0 1 1 1

0 0 0 0 0

0 1 1 1 1

0 0 0 0 0

1 1 1 1 1

1 0 1 1 1

1 0 0 0 1

1 0 1 1 1

0 1 1 0 0

0 0 0 0 0

1 1 0 0 1

1 0 1 1 1

1 1 1 0 0

1 0 1 1 1

1 0 1 1 1

1 0 1 1 1

0 0 0 0 0

0 0 0 0

0 0 0 0

Remainder was 0000 as required.

iii. Repeat this exercise using polynomials. \

The polynomial for the divisor is: x4 + x2 + x + 1

The polynomial for the dataword is: x9 + x7 + x4 + x3 + x2 + x1

a) In order to perform the operations required when using the polynomial form we must
first multiply the dataword by x4 (equivalent to adding the 4 zeros in the binary division
method. This yields the new polynomial as: x13 + x11 + x8 + x7 + x6 + x5 we now
proceed to divide this by the divisor obtained above:
x4 + x2 + x + 1 ) x13 + x11 + x8 + x7 + x6 + x5

Following the standard procedure, we obtain the remainder as x3 + x1, so that the bit
pattern for this will be 1010 which agrees with our previous binary division result

x 9+x 6+x 5+x 3+x 2+x1

x 4+x 2+x 1 1 x 13+x 11+x 8+x 7+x 6+x5

x 13+x 11+x 10+x9

x 10 +x 9 +x 8 +x 7+x 6+x5

x 10+x 8+x 7+x6

x 9+x5

x 9 +x 7 +x 6 + x5

x 7 +x6

x 7+x 5+x 4+x3

x 6+x 5+x 4+x3

x 6+x 4+x 3+x2

x 5+x2

x 5+x 3+x 2+x1

x 3 +x1
b) When we repeat the process for the complete message with CRC attached, the required polynomial
will be x13 + x11 + x8 + x7 + x6 + x5 + x3 + x1

Thus we can then perform the required division once again and we find a zero remainder which
verifies the required result.

x 9+x 6+x 5+x 3+x 2+x1

x 4+x 2+x 1 1 x 13+x 11+x 8+x 7+x 6+x 5+x 3 +x1

x 13+x 11+x 10+x9

x 10+x 9+x 8+x 7+x 6+x 5+x 3+x1

x 10+x 8+x 7+x6

x 9+x 5+x 3+x1

x 9+x 7+x 6+x5

x 7+x 6+x 3+x1

x 7+x 5+x 4+x3

x 6+x 5+x 4+x1

x 6+x 4+x 3+x2

x 5+x 3+x 2+x1

x 5+x 3+x 2+x1

0
Q.3 A sender needs to send the four data items 0x3456, 0xABCC, Ox02BC,
and 0xEEEE. Answer the following:

a. Find the checksum at the sender site.

1 2 2 2 Carries
3 4 5 6
A B C C
0 2 B C
E E E E
0 0 0 0 Checksum(Initial)
D 1 C C Sum(Partial)
1
D 1 C D Sum
2 E 3 2 Checksum (to send)

b. Find the checksum at the receiver site if there is no error.


1 2 2 2
3 4 5 6
A B C C
0 2 B C
E E E E
2 E 3 2 Checksum(Initial)
F F F E Sum(Partial)
1
F F F F Sum
0 0 0 0 Checksum (to send)
c. Find the checksum at the receiver site if the second data
item is changed to 0xABCE.
2 3 3 3 Carries
3 4 5 6
A B C E
0 2 B C
E E E E
2 E 3 2 Checksum(Initial)
0 0 0 0 Sum(Partial)
2
0 0 0 2 Sum
F F F D Checksum (to send).

d. Find the checksum at the receiver site if the second data


item is changed to 0xABCE and the third data item is
changed to 0x02BA.

1 2 2 2
3 4 5 6
A B C E
0 2 B A
E E E E
2 E 3 2 Checksum(Initial)
F F F E Sum(Partial)
1
F F F F Sum
0 0 0 0 Checksum (to send)

Q.4 What is the hexadecimal equivalent of the following Ethernet addresses


01011010 00010001 01010101 00011000 00001111 \
5A:11:55:18:0F

Q.5 Byte-stuff the data shown in the following figure.

ES ES ES FLA ES ES ES ES ES ES FLA
C C C G C C C C C C G

Q.6 Bit-stuff the data shown below.


000111111100111110100011111111111000011111
000111110110011111001000111110
11111010000111110

Q.7 Using a 5-bit sequence numbers, what is the maximum size of the send
and receive windows for each of the following protocols?
i. Stop and Wait
Send Window=1
Receive Window = 1
ii. Go-Back-N ARQ
Send Window = 25-1=31
Receive Window = 1
iii. Selective Repeat ARQ
Send Window = 25-1=16

Receive Window = 25-1=16

Q.8 A system uses the Stop-and-Wait ARQ protocol. If each packet carries
1000 bits of data, how long does it take to send 1 million bits of data if
the distance between the sender and receiver is 5000 Km and the
propagation speed is 2*108 metres? Ignore transition, waiting, and
processing delays. We assume no data or control frame is lost or
damaged.
Frames = (1,000,000 bits of data) / (1,000 bits of data per frame) = 1,000 frames
Data frame trip time = (5,000 Km) / (200,000 Km/s) = 25 ms
ACK trip time = (5,000 Km) / (200,000 Km/s) = 25 ms
Delay for 1 frame = 25 ms + 25 ms = 50 ms per frame
Total delay = (1000 frames) x (50 ms per frame) = 50 s

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