Net

7
Assignment of Computer Networks (CSE306) Assignment 4 SUBMITTED BY: SUBMITTED TO: Name: Rashik bhatt Ms. Navdeep Kaur Class: BCA-MCA Dept: CSE\IT Reg no.: 3010060019 Roll no.: 11

Transcript of Net

Page 1: Net

Assignment of Computer Networks (CSE306)

Assignment 4

SUBMITTED BY: SUBMITTED TO:

Name: Rashik bhatt Ms. Navdeep Kaur

Class: BCA-MCA Dept: CSE\IT

Reg no.: 3010060019

Roll no.: 11

Page 2: Net

Q.1): - What kind of errors is undetected by VRC, LRC, CRC and CHECKSUM and which is the best method of error detection. Give reason.

Ans: - VRC: - Simply parity check can detect all single bit errors. It can also detect burst errors as long as the total number of bits changed is odd (1, 3, 5, etc) .suppose that we have an even parity data where total number of 1s including the parity bit is 6:1000111011. If any 3 bits change value, then the resulting parity will be odd and the errors will be detected: 1111111011:9, 0110111011:7, 1100010011:5-all odd. The checker will return a result of 1, and the data unit would be rejected. The same hold true for any odd number of errors.

LRC: - LRC increases the likelihood of detecting burst errors. If two bits in one data unit are damaged and two bits in exactly the same position in another data unit are also damaged, the checker will not detect an error. For example there are two data units 11110000 and 11000011. If first and last bit in each of them are changed, making the data unit read 01110001 and 01000010 then the errors cannot be detected by this method.

CRC: - Cyclic Redundancy Checksum (CRC).The CRC error detection method treats the packet of data to be transmitted as a large polynomial. The transmitter takes the message polynomial and using polynomial arithmetic, divides it by a given generating polynomial. The quotient is discarded but the remainder is “attached” to the end of the message (remainder (mod) arithmetic)

Check Sum: - the check sum method detects all errors involving an odd number of bits as well as most errors involving an even number of bits. However, if one or more bits of a segment are damaged and the corresponding bit or bits of opposite value in second segment are also damaged, the sum of those columns will not changed and the receiver will not detect the error.

The best method of error detection: - CRC is very effective error detection method because-

CRC can detect all burst errors that affect an odd number of bits.

CRC can detect all burst errors of length less than or equal to the degree of polynomial.

CRC can detect, with a very high probability, burst errors of length greater than the degree of the polynomial.

Q.2: - Design a bidirectional algorithm for the Simplest Protocol using piggybacking. Note that the both parties need to use the same algorithm.

Ans: - Sender Algorithm

Page 3: Net

Receiver Algorithm:

Page 4: Net

Q.3: -.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*10( pow )8 m? Ignore transmission, waiting and processing delay. We assume that no data or control frame is lost or damaged

Ans. damaged.

Ans: - The propagation delay is given by tp = d/c

Where d = distance between transmitter and receiver, c = speed of light, d = 5000 and c = 3000000

So, tp = 5000/300,000 = 0.02

Transmission delay tt = L/λ

Where L = number of bits in the frame and λ = transmission rate in bits per sec.

Here L = 1000 and λ = 200000000

So, tt = 1000/200000000 = 0.000005

Total time taken T = tt+2tp

Page 5: Net

T = 0.000005+0.02

T = 0.020005

Q.4: - A network with one primary and four secondary stations uses polling. The size of the poll, ACk, and NAK frames are 32 bytes each. Each station has 5 frames to send. How many total bytes are exchanged if there is no limitation on the number of frames a station can send in response to a poll?

Ans. As there are one primary and 4 secondary station uses polling. In polling the primary device controls the line & secondary device follows its instruction. It is up to the primary to determine which device is allowed to use the channel at a given time. If the primary wants to receive data it asks the secondary’s if they have anything to send. If the primary wants to send data it tells the targets secondary to get ready to receive this function is called selecting.So, here are 4 secondary stations. The size of each frame is 32 bytes and each station having 5 frames to send. So, total bytes exchanged will be-4* 5* 32 = 640 bytes.

Q.5) Write the following masks in the slash notation (/n)

a. 255.0.0.0

b.255.255.224.0

c. 255.255.255.0

d.255.255.240.0

Ans:- Mask Slash notation

255.0.0.0 = /8

255.255.224.0 = /19

255.255.255.0 = /24

255.255.240.0 = /28