Docsity

Computer Networks Assignment from NIT Hamirpur: Window Size and Throughput Calculations, Assignments of Computer Networks

Partial preview of the text

Download Computer Networks Assignment from NIT Hamirpur: Window Size and Throughput Calculations and more Assignments Computer Networks in PDF only on Docsity!

NATIONAL INSTITUTE OF TECHNOLOGY HAMIRPUR

Himachal Pradesh – 177 005, INDIA

COMPUTER SCIENCE & ENGINEERING

Even SEMESTER, 2020

COMPUTER NETWORKS Assignment

(Numerical Assignment)

By ARVIND SINGH

R. No- 17544

Numerical ASSIGNMENT

ANS 1.

a) Here we have a window size of N = 4. Suppose the receiver has received packet k-1, and has ACKed that and all other preceding packets.

  • If all of these ACK’s have been received by sender, then sender’s window is [k, k+N-1].
  • Suppose next that none of the ACKs have been received at the sender.
  • In this second case, the sender’s window containsk-1 and the N packets up to and includingk-1. The sender’s window is thus [k-N, k-1].
  • By these arguments, the senders window is of size 4 and begins somewhere in the range [k- 4 , k]. b) If the receiver is waiting for packetk, then it has received (and ACKed) packetk-1 and theN- 1 packets before that.
  • If none of those NACKs have been yet received by the sender, then ACK messages with values of [k-N, k- 1] may still be propagating back.
  • Because the sender has sent packets [k-N, k-1], it must be the case that the sender has already received an ACK fork-N-1.
  • Once the receiver has sent an ACK fork-N-1, assuming no that the ack message is not lost resulting in retransmission, it will never send an ACK that is less thatk-N-1. Thus the range of in-flight ACK values can range fromk-N-1 tok-1. Given N=4, the range of in-flight ACK values can range from k - 5 to k - 1. ANS 2. Given- Packet size = 32 bytes Round Trip Time = 80 msec Bandwidth = 128 Kbps Calculating Transmission Delay - Transmission delay (Tt) = Packet size / Bandwidth = 32 bytes / 128 Kbps = (32 x 8 bits) / (128 x 10^3 bits per sec) = 2 msec Calculating Propagation Delay - Propagation delay (Tp) = Round Trip Time / 2 = 80 msec / 2 = 40 msec

hence, N = (10.304 * 10^3)/10 = 1030 stations. ANS 5. a) (1 – p(A))^4 p(A) where, p(A)= probability that A succeeds in a slot p(A)= p(A transmits and B does not and C does not and D does not) = p(A transmits) p(B does not transmit) p(C does not transmit) p(D does not transmit) = p(1 – p) (1 – p)(1-p) = p(1 – p)^3 Hence, p(A succeeds for first time in slot 5) = (1 – p(A))^4 p(A) = (1 – p(1 – p)^3 )^4 p(1 – p)^3 b) p(A succeeds in slot 4) = p(1-p)^3 p(B succeeds in slot 4) = p(1-p)^3 p(C succeeds in slot 4) = p(1-p)^3 p(D succeeds in slot 4) = p(1-p)^3 p(either A or B or C or D succeeds in slot 4) = 4 p(1-p)^3 (because these events are mutually exclusive) c) p(some node succeeds in a slot) = 4 p(1-p)^3 p(no node succeeds in a slot) = 1 - 4 p(1-p)^3 Hence, p(first success occurs in slot 3) = p(no node succeeds in first 2 slots) p(some node succeeds in 3 rdslot) = (1 - 4 p(1-p)^3 )^2 4 p(1-p)^3 ANS 6. Time t Event 0 A and B begin transmission 245 A and B and detect collision 245 + 32 = 277 A and B and finish transmitting jam signal 277 + 245 = 522 A’s last bit arrives at B;A detects an idle channel 522 A starts transmitting B returns to step 523 277 + 512 = 789 B must sense idle channel for 96 bit times before it transmits(KB= 1, back-off time =KB·512) 524 522 + 245 = 767 A’s transmission reaches B Because A’s retransmission reaches before B’s scheduled retransmission time (789 + 96) , B refrains from transmitting while A retransmits. Thus A and B do not collide. Thus the factor 512 appearing in the exponential back-off algorithm is sufficiently large.