Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECE358: Computer Networks Spring 2012

Similar presentations


Presentation on theme: "ECE358: Computer Networks Spring 2012"— Presentation transcript:

1 ECE358: Computer Networks Spring 2012
Solutions to Homework #2

2 P 1. Suppose the information content of a packet is the bit pattern and an even parity scheme is being used. What would the value of the field containing the parity bits be for the case of a two-dimensional parity scheme? Your answer should be such that a minimum-length checksum field is used. To get a minimum –length checksum field ( minimum parity bits), the two-dimensional parity scheme should be 4x4. 1 In the two-dimensional even parity scheme, the values of the parity bits are set such that the number of 1s in each of the ellipses shown is even.

3 P 2. Show (give an example) that two-dimensional parity checks can correct and detect a single bit error. Show (give an example of) a double-bit error that can be detected but not corrected Sent Frame Received Frame w/ 1 error 1 1 The error can be detected and corrected. Received Frame w/ 2 error 1 Errors can be detected but cannot be corrected.

4 P 5. Consider the 5-bit generator, G=10011, and suppose that D has the value What is the value of R (R is the CRC)? D.2r 1 G CRC

5 P 6. Consider the previous problem, but suppose that D has the value a
P 6. Consider the previous problem, but suppose that D has the value a b c a. 1 CRC

6 Continuing P 6. b. 1 CRC

7 Continuing P 6. 1 c. CRC

8 P 8. In the class, we provided an outline of the derivation of the efficiency of slotted ALOHA. In this problem we'll complete the derivation. a. Recall that when there are N active nodes, the efficiency of slotted ALOHA is Np( 1 -p)N-1. Find the value of p that maximizes this expression. b. Using the value of p found in (a), find the efficiency of slotted ALOHA by letting N approach infinity. Hint: (1 - 1/N)N approaches 1 𝑒 as N approaches infinity. a. 𝑝 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 =𝑁𝑝 (1−𝑝) 𝑁−1 𝑝 ′ 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 =−𝑁𝑝 𝑁−1 1−𝑝 𝑁−2 +𝑁 (1−𝑝) 𝑁−1 = 𝑁 (1−𝑝) 𝑁−2 1−𝑝 −𝑝 𝑁−1 = 𝑁 (1−𝑝) 𝑁−2 1−𝑁𝑃 At the stationary points of 𝑝 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 , 𝑝 ′ 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 =0 𝑁 (1−𝑝) 𝑁−2 1−𝑁𝑃 =0  Either 𝑁(1−𝑝) 𝑁−2 =0 or [1−𝑁𝑃]=0 For 𝑁(1−𝑝) 𝑁−2 =0  𝑝=1 (minima) For [1−𝑁𝑃]=0  𝑝= 1 𝑁 = 𝑝 ∗ (Maximum) b. 𝑝 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 𝑝 ∗ =𝑁 1 𝑁 (1− 1 𝑁 ) 𝑁−1 = (1− 1 𝑁 ) 𝑁 (1− 1 𝑁 ) Efficiency= lim 𝑁→∞ 𝑝 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 𝑝 ∗ = lim 𝑁→∞ 1− 1 𝑁 𝑁 lim 𝑁→∞ 1− 1 𝑁 = 1 𝑒 1 = 1 𝑒

9 P 10. Consider two nodes, A and B, that use the slotted ALOHA protocol to contend for a channel. Suppose node A has more data to transmit than node B, and node A’s retransmission probability 𝑝 𝐴 is greater than node B's retransmission probability 𝑝 𝐵 . a. Provide a formula for node A's average throughput. What is the total efficiency of the protocol with these two nodes? b. If pA = 2pB is node A's average throughput twice as large as that of node B? Why or why not? If not, how can you choose pA and pB to make that happen? c. In general, suppose there are N nodes, among which node A has retransmission probability 2p and all other nodes have retransmission probability p. Provide expressions to compute the average throughputs of node A and of any other node. 𝑇ℎ𝑟𝑜𝑢𝑔ℎ𝑝𝑢𝑡 𝐴 = 𝑝 𝐴 𝑠𝑢𝑐𝑐𝑒𝑒𝑑𝑠 = 𝑝 𝐴 1− 𝑝 𝐵 𝐸𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑐𝑦= 𝑝 𝐴 1− 𝑝 𝐵 + 𝑝 𝐵 1− 𝑝 𝐴 A ′ s 𝑡ℎ𝑟𝑜𝑢𝑔ℎ𝑝𝑢𝑡= 𝑝 𝐴 1− 𝑝 𝐵 = 2𝑝 𝐵 1− 𝑝 𝐵 = 2𝑝 𝐵 −2 𝑝 𝐵 2 B ′ s 𝑡ℎ𝑟𝑜𝑢𝑔ℎ𝑝𝑢𝑡= 𝑝 𝐵 1− 𝑝 𝐴 = 𝑝 𝐵 1− 2𝑝 𝐵 = 𝑝 𝐵 −2 𝑝 𝐵 2 clearly, A’s throughput ≠ 2 B’s throughput In order to make A ′ s 𝑡ℎ𝑟𝑜𝑢𝑔ℎ𝑝𝑢𝑡= 2×B ′ s 𝑡ℎ𝑟𝑜𝑢𝑔ℎ𝑝𝑢𝑡 ⇒𝑝 𝐴 1− 𝑝 𝐵 =2 𝑝 𝐵 1− 𝑝 𝐴  𝑃 𝐴 = 2 𝑃 𝐵 1+ 𝑃 𝐵 A ′ s 𝑡ℎ𝑟𝑜𝑢𝑔ℎ𝑝𝑢𝑡=2𝑝 1−𝑝 𝑁−1 Other node ′ s 𝑡ℎ𝑟𝑜𝑢𝑔ℎ𝑝𝑢𝑡=𝑝 1−𝑝 𝑁−2 × 1−2𝑝

10 𝑃 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 𝑖𝑛 4 𝑡ℎ 𝑠𝑙𝑜𝑡 =4𝑝 1−𝑝 3
P 11. Suppose four active nodes—nodes A, B, C and D—are competing for access to a channel using slotted ALOHA. Assume each node has an infinite number of packets to send. Each node attempts to transmit in each slot with probability p. The first slot is numbered slot 1, the second slot is numbered slot 2, and so on. a. What is the probability that node A succeeds for the first time in slot 5? b. What is the probability that some node (either A, B, C or D) succeeds in slot 4? c. What is the probability that the first success occurs in slot 3? d. What is the efficiency of this four-node system? 𝑃 𝐴 = 𝑃 𝐵 = 𝑃 𝐶 = 𝑃 𝐷 =𝑝 , 𝑃 𝐴 𝑠𝑢𝑐𝑐𝑒𝑒𝑑𝑠 =𝑝 1−𝑝 3 𝑃 𝐴 𝑠𝑢𝑐𝑐𝑒𝑒𝑑𝑠 𝑖𝑛 5 𝑡ℎ 𝑠𝑙𝑜𝑡 = 1− 𝑃 𝐴 𝑠𝑢𝑐𝑐𝑒𝑒𝑑𝑠 4 × 𝑃 𝐴 𝑠𝑢𝑐𝑐𝑒𝑒𝑑𝑠 = 1−𝑝 1−𝑝 𝑝 1−𝑝 3 𝑃 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 𝑖𝑛 4 𝑡ℎ 𝑠𝑙𝑜𝑡 =4𝑝 1−𝑝 3 𝑃 1 𝑠𝑡 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 𝑖𝑠 𝑖𝑛 𝑠𝑙𝑜𝑡 3 = 1− 𝑝 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 𝑝 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 = 1−4𝑝 1−𝑝 𝑝 1−𝑝 3 𝐸𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑐𝑦= 𝑝 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 =4𝑝 1−𝑝 3

11 P 12. Graph the efficiency of slotted ALOHA and pure ALOHA as a function of p for the following values of N: a. N=15. b. N=25. c. N=35. 𝐸𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑐𝑦=𝑁𝑝 1−𝑝 2 𝑁−1

12 Continuing P 12. 𝐸𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑐𝑦=𝑁𝑝 1−𝑝 𝑁−1

13 P 13. Consider a broadcast channel with N nodes and a transmission rate of R bps. Suppose the broadcast channel uses polling (with an additional polling node) for multiple accesses. Suppose the amount of time from when a node completes transmission until the subsequent node is permitted to transmit (that is, the polling delay) is 𝑑 𝑝𝑜𝑙𝑙 . Suppose that within a polling round, a given node is allowed to transmit at most Q bits. What is the maximum throughput of the broadcast channel? The polling- round length= 𝑁 𝑄 𝑅 + 𝑑 𝑝𝑜𝑙𝑙 sec # of bits transmitted in a polling-round= NQ bits 𝑇ℎ𝑟𝑜𝑢𝑔ℎ𝑝𝑢𝑡= 𝑁𝑄 𝑁 𝑄 𝑅 + 𝑑 𝑝𝑜𝑙𝑙 = 𝑄 𝑄 𝑅 + 𝑑 𝑝𝑜𝑙𝑙 bit/sec

14 waiting time = 100×512 𝑏𝑖𝑡𝑠 10× 10 6 𝑏𝑖𝑡/𝑠𝑒𝑐 =5.12 𝑚𝑠𝑒𝑐
P 17. Recall that with the CSMA/CD protocol, the adapter waits K * 512 bit times after a collision, where K is drawn randomly. For k= 100, how long does the adapter wait until returning to Step 2 for a 10 Mbps Ethernet? For a 100 Mbps Ethernet? For 10Mbps Ethernet waiting time = 100×512 𝑏𝑖𝑡𝑠 10× 𝑏𝑖𝑡/𝑠𝑒𝑐 =5.12 𝑚𝑠𝑒𝑐 For 100Mbps Ethernet waiting time = 100×512 𝑏𝑖𝑡𝑠 100× 𝑏𝑖𝑡/𝑠𝑒𝑐 =512 𝜇𝑠𝑒𝑐

15 P 18. Suppose nodes A and B are on the same 10 Mbps broadcast channel, and the propagation delay between the two nodes is 325 bit times. Suppose CSMA/CD and Ethernet packets are used for this broadcast channel. Suppose node A begins transmitting a frame and, before it finishes, node B begins transmitting a frame. Can A finish transmitting before it detects that B has transmitted? Why or why not? If the answer is yes, then A incorrectly believes that its frame was successfully transmitted without a collision. Hint: Suppose at time t= 0 bits, A begins transmitting a frame. In the worst case, A transmits a minimum-sized frame of bit times. So A would finish transmitting the frame at t = bit times. Thus, the answer is no, if B's signal reaches A before bit time t = bits. In the worst case, when does B's signal reach A? At t=0 A starts transmitting. At t= =576 bit times , A would finish transmitting (in the worst case, A sends the minimum frame size so that it would finish transmitting shortly and consequently would not hear B). In the worst case, B begins transmitting at time t=324, which is the time right before the first bit of A’s frame arrives at B. At time t= =649 B's first bit arrives at A. Because 649> 576, A finishes transmitting before it detects that B has already started transmitting. So A incorrectly thinks that its frame was successfully transmitted without a collision.

16 Continuing P 18. 𝑑 𝑃𝑟𝑜𝑝 =325 𝑏𝑖𝑡 𝑡𝑖𝑚𝑒𝑠 A B 10Mbps Ethernet t=0 t=324
576<649  A finishes transmitting before hearing B

17 B refrains from transmitting
P 19. Suppose nodes A and B are on the same 10 Mbps broadcast channel, and the propagation delay between the two nodes is 245 bit times. Suppose A and B send Ethernet frames at the same time, the frames collide, and then A and B choose different values of K in the CSMA/CD algorithm. Assuming no other nodes are active, can the retransmissions from A and B collide? For our purposes, it suffices to work out the following example. Suppose A and B begin transmission at t= 0 bit times. They both detect collisions at t =245 bit times. Suppose 𝑘 𝐴 =0 and 𝑘 𝐵 =1. At what time does B schedule its retransmission? At what time does A begin transmission? (Note: the nodes must wait for an idle channel after returning to step 2). At what time does A’s signal reach B? does B refrain from transmitting at its scheduled time? 𝑑 𝑃𝑟𝑜𝑝 =245 𝑏𝑖𝑡 𝑡𝑖𝑚𝑒𝑠 A B A sends Jam Signal (48bits) 10Mbps Ethernet B sends Jam Signal (48bits) t=0 t=0 t=245 t=245 t=245+48=293 t=293 (245+48) t= =538 t=538 ( ) B refrains from transmitting t=538+96=634 t=805 ( ) t=879 ( ) t=901 (805+96) A senses for an idle channel (96 bits) B senses for an idle channel (96 bits) B’s scheduled time for retransmission

18 t=0, A and B begin transmission. t=245, A and B detect collision.
Continuing P 19. t=0, A and B begin transmission. t=245, A and B detect collision. t=293, A and B finish transmitting jam signal. t= = 538, B's last bit arrives at A; A detects an idle channel. t=538+96=634, A starts transmitting = 805, B's scheduled time. B must sense idle channel for 96 bit times before it transmits =879, A's transmission reaches B Because A's retransmission reaches B before B's scheduled retransmission time (805+96), B refrains from transmitting while A retransmits. Thus A and B do not collide. Thus the factor 512 appearing in the exponential backoff algorithm is sufficiently large.


Download ppt "ECE358: Computer Networks Spring 2012"

Similar presentations


Ads by Google