mid term exam sol

3
Name: Student Id: Data Communication Mid-Term Exam Date: Oct 26, 2012 Q1. For Stop-and-Wait ARQ, for 10 data packets sent, _______ acknowledgments are needed. a. 1 b. 10 - ans c. 2 d. None of these Q2. Data link control deals with the design and procedures for ______ communication. a. Node to node - ans b. End host to End host c. Process to process d. None of the above Q3. Error and Flow control algorithms are defined in the a. Data link layer -ans b. Network layer c. Transport Layer - ans d. Physical Layer Q4. You are running a PC at home, which is connected to the internet using a modem over a telephone communication link. The modem can transfer data at a maximum transmission rate of 28,8000 bits/sec. (a) How long will it take to download a 5000000 byte file from a server? (Assume propagation time is 0). ans - 5000000/288000 (b) Now, assume that the server is located at a distance of 10,000 km from your PC. The data travel at a speed of light, i.e., 3 * 10 8 meter/sec. How long will it take to download a 5000000 byte file from the server? ans = (5000000/2880000) + (10 7 /3 * 10 8 ) Q5. Given a message M=1010001101, determine the CRC using the polynomial P=x 5 + x 4 + x 2 + 1, i.e., the divisor is 110101. (Ans: 01110) What is the final message? 101000110101110 Q6. Consider the use of hamming code to send 11-bit message, 10011011011. You will need 15 bits. Show the hamming code. (hint) ******************** Codeword | 1 0 0 1 1 0 1 1 0 1 1

Upload: h-k

Post on 17-Dec-2014

1.310 views

Category:

Documents


10 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Mid term exam sol

Name:

Student Id:

Data Communication

Mid-Term Exam

Date: Oct 26, 2012

Q1. For Stop-and-Wait ARQ, for 10 data packets sent, _______ acknowledgments are needed.

a. 1

b. 10 - ans

c. 2

d. None of these

Q2. Data link control deals with the design and procedures for ______ communication.

a. Node to node - ans

b. End host to End host

c. Process to process

d. None of the above

Q3. Error and Flow control algorithms are defined in the

a. Data link layer -ans

b. Network layer

c. Transport Layer - ans

d. Physical Layer

Q4. You are running a PC at home, which is connected to the internet using a modem over a telephone

communication link. The modem can transfer data at a maximum transmission rate of 28,8000 bits/sec.

(a) How long will it take to download a 5000000 byte file from a server? (Assume propagation time is 0).

– ans - 5000000/288000

(b) Now, assume that the server is located at a distance of 10,000 km from your PC. The data travel at a

speed of light, i.e., 3 * 108 meter/sec. How long will it take to download a 5000000 byte file from the

server?

–ans = (5000000/2880000) + (107/3 * 10

8)

Q5. Given a message M=1010001101, determine the CRC using the polynomial

P=x5 + x

4 + x

2 + 1, i.e., the divisor is 110101. (Ans: 01110)

What is the final message? 101000110101110

Q6. Consider the use of hamming code to send 11-bit message, 10011011011. You will need 15 bits.

Show the hamming code.

(hint) ********************

Codeword | 1 0 0 1 1 0 1 1 0 1 1

Page 2: Mid term exam sol

--------|----------------------------------------------

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

Bit 1 = (Bit 1 XOR BIT3 XOR Bit 7 XOR Bit 9 XOR Bit11 XOR Bit 14 XOR Bit 15)

Bit 2 = (Bit 2 XOR Bit 3 XOR Bit 6 XOR Bit 7 XOR Bit 10 XOR Bit 11 XOR Bit 14 XOR Bit

15)

Bit 4 = (Bit 4 XOR Bit 5 XOR Bit 6 XOR But 7 XOR Bit 12 XOR Bit 13 XOR Bit 14 XOR Bit

15)

Bit 8 = (Bit 8 XOR Bit 9 XOR Bit 10 XOR Bit 11 XOR Bit 12 XOR Bit 13 XOR Bit 14 XOR Bit

15)

Therefore, the final Hamming codeword is:

Codeword | 1 1 1 0 0 0 1 1 1 0 1 1 0 1 1

---------|----------------------------------------------

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

******************************************

Now invert the 13 bit and show that it is properly detected and corrected.

Q7. A data link layer uses the following character encoding:

C: 01000011; E: 01000101; S: 01010011; FLAG: 01111110; ESC: 10011001

For the eight character frame:

C S ESC C E FLAG E E

Show the bit sequence actually transmitted in binary, with the flag bytes at each end (SFD, EFD) when bit

stuffing is used.

1000011 01010011 10011001 01000011 01000101 011111010

01000101 01000101

Q8. (Assume sliding window protocol is used)

Each frame contains a sequence number S.

The ACK number, K, acknowledges all frames up to K-1 and expects the next frame with sequence number

K.

The sequence number is modulo W. i.e. S Modulo W returns the remainder when S is divided by W. This

restrains the value of S to stay between 0 and W-1. For ex: S=2 and W=8, S modulo W = 2. S=10 and W=8,

S modulo W = 2.

a) How many frames a sender can send without getting an acknowledgment, if the initial sequence

number is S, and Window size is W. W-S

b) Assume windows size W= 8. The frames with sequence S = 5,6,7,0,1 are sent, but no ACK received

yet. What frames is sender allowed to send? Frame 2 ,3, 4

c) Assume window size, W=8. What is the value of Sf and Sn for (b) if the following ACK arrives

a. Acknowledgment frame with value 2 arrive: ACK 2, S = 2,3,4,5,6,7,0,1 and Sf=2, Sn=2

Page 3: Mid term exam sol

b. Acknowledgment frame with value 6 arrive: ACK 6, S = 6,7,0,1,2,3,4,5, and Sf=6, sn=2

For each ACK, also write the acknowledged frame and the draw the window showing the position of sf and

sn Q9. Fill in the numbers as explained below for the following illustrations.

Top Left: ACK 6.

Top Right: copies discarded