GATE 2012
82 questions
MCQ 821-mark 39 · 2-mark 43
Questions 56–60 of 82
Consider the following transactions with data items P and Q initialized to zero:
T1 :read (P);
read (Q);
if P = 0 then Q := Q + 1 ;
write (Q).
T2 : read (Q);
read (P);
if Q = 0 then P := P + 1 ;
write (P). Any non-serial interleaving of T1 and T2 for concurrent execution leads toAnswer: (B)
Take any non-serial interleaving. T1 reads , reads , then writes . T2 reads , reads , then writes .
- Suppose comes before . is the last operation of T2 and is the first operation of T1, so all of T2 runs before all of T1. That is a serial schedule, which is not allowed. So comes before , which gives the edge .
- Suppose comes before . is the last operation of T1 and is the first operation of T2, so the schedule is again serial. So comes before , which gives the edge .
The two edges make a cycle in the precedence graph, so every non-serial interleaving is not conflict serializable. Option (C) says the opposite. Option (D) is wrong because a precedence graph can be drawn for any schedule.
Answer: (B)
- Suppose comes before . is the last operation of T2 and is the first operation of T1, so all of T2 runs before all of T1. That is a serial schedule, which is not allowed. So comes before , which gives the edge .
- Suppose comes before . is the last operation of T1 and is the first operation of T2, so the schedule is again serial. So comes before , which gives the edge .
The two edges make a cycle in the precedence graph, so every non-serial interleaving is not conflict serializable. Option (C) says the opposite. Option (D) is wrong because a precedence graph can be drawn for any schedule.
Answer: (B)
Consider a source computer (S) transmitting a file of size bits to a destination computer (D) over a network of two routers (R1 and R2) and three links (L1, L2, and L3). L1 connects S to R1; L2 connects R1 to R2; and L3 connects R2 to D. Let each link be of length 100 km. Assume signals travel over each link at a speed of meters per second. Assume that the link bandwidth on each link is 1Mbps. Let the file be broken down into 1000 packets each of size 1000 bits. Find the total sum of transmission and propagation delays in transmitting the file from S to D?
Answer: (A)
Check each part:
- For one packet, the transmission time is ms. The propagation time on one link is ms.
- The packets are pipelined. The source sends all 1000 packets in 1000 ms. After that, the last packet needs 2 more transmissions (at R1 and R2) and 3 propagations.
Total = 1000 + 2 1 + 3 1 = 1005 ms
Answer: 1005 ms
- For one packet, the transmission time is ms. The propagation time on one link is ms.
- The packets are pipelined. The source sends all 1000 packets in 1000 ms. After that, the last packet needs 2 more transmissions (at R1 and R2) and 3 propagations.
Total = 1000 + 2 1 + 3 1 = 1005 ms
Answer: 1005 ms
An Internet Service Provider (ISP) has the following chunk of CIDR-based IP addresses available with it: 245.248.128.0/20. The ISP wants to give half of this chunk of addresses to Organization A, and a quarter to Organization B, while retaining the remaining with itself. Which of the following is a valid allocation of addresses to A and B?
Answer: (A)
The block 245.248.128.0/20 spans third octet values 128 to 143 (4096 addresses).
- Half of it is 2048 addresses, a /21 block. A /21 is 8 wide and must start at a multiple of 8: 128 to 135 or 136 to 143.
- A quarter is 1024 addresses, a /22 block. A /22 is 4 wide and starts at a multiple of 4: 128, 132, 136 or 140.
- The two blocks must not overlap.
- (A) A = 245.248.136.0/21 (136 to 143), B = 245.248.128.0/22 (128 to 131). Sizes are right, both are aligned, and they do not overlap. Valid.
- (B) A = 128.0/21 (128 to 135) already contains B = 128.0/22 (128 to 131). They overlap.
- (C) A is given a /22, not a /21, and B = 132.0/21 does not start at a multiple of 8, so it is not a valid block.
- (D) A is given a /24, not a /21, and B = 132.0/21 again does not start at a multiple of 8.
Answer: (A)
- Half of it is 2048 addresses, a /21 block. A /21 is 8 wide and must start at a multiple of 8: 128 to 135 or 136 to 143.
- A quarter is 1024 addresses, a /22 block. A /22 is 4 wide and starts at a multiple of 4: 128, 132, 136 or 140.
- The two blocks must not overlap.
- (A) A = 245.248.136.0/21 (136 to 143), B = 245.248.128.0/22 (128 to 131). Sizes are right, both are aligned, and they do not overlap. Valid.
- (B) A = 128.0/21 (128 to 135) already contains B = 128.0/22 (128 to 131). They overlap.
- (C) A is given a /22, not a /21, and B = 132.0/21 does not start at a multiple of 8, so it is not a valid block.
- (D) A is given a /24, not a /21, and B = 132.0/21 again does not start at a multiple of 8.
Answer: (A)
In the IPv4 addressing format, the number of networks allowed under Class C addresses is
Answer: (C)
In Class C, the first 3 bits are fixed as 110. The network part has 24 bits in all.
Network bits that can change = 24 3 = 21 networks.
Answer:
Network bits that can change = 24 3 = 21 networks.
Answer:
Consider an instance of TCP's Additive Increase Multiplicative Decrease (AIMD) algorithm where the window size at the start of the slow start phase is 2 MSS and the threshold at the start of the first transmission is 8 MSS. Assume that a timeout occurs during the fifth transmission. Find the congestion window size at the end of the tenth transmission.
Answer: (C)
Go through the transmissions one by one:
- Transmissions 1-3 (slow start): 2, 4, 8. The threshold is reached at 8.
- Transmissions 4 and 5: 9, 10 (additive increase). The timeout happens during the 5th.
- The new threshold is 10/2 = 5. The window starts again at 2.
- Transmission 6: 2, 7: 4, 8: 5 (held at the threshold), 9: 6, 10: 7
Answer: 7 MSS
- Transmissions 1-3 (slow start): 2, 4, 8. The threshold is reached at 8.
- Transmissions 4 and 5: 9, 10 (additive increase). The timeout happens during the 5th.
- The new threshold is 10/2 = 5. The window starts again at 2.
- Transmission 6: 2, 7: 4, 8: 5 (held at the threshold), 9: 6, 10: 7
Answer: 7 MSS