GATE 2015 (Session 2)
64 questions
MCQ 42 · NAT 221-mark 29 · 2-mark 35
Questions 36–40 of 64
Host A sends a UDP datagram containing 8880 bytes of user data to host B over an Ethernet LAN. Ethernet frames may carry data up to 1500 bytes (i.e. MTU=1500 bytes). Size of UDP header is 8 bytes and size of IP header is 20 bytes. There is no option field in IP header. How many total number of IP fragments will be transmitted and what will be the contents of offset field in the last fragment?
Answer: (C)
Data to send in IP = 8880 + 8 (UDP header) = 8888 bytes. Each fragment can hold at most 1500 20 = 1480 bytes of data.
6 fragments carry 6 1480 = 8880 bytes. 8 bytes are left over, so 7 fragments in total.
Offset of the last fragment = 8880 / 8 = 1110
Answer: 7 and 1110
6 fragments carry 6 1480 = 8880 bytes. 8 bytes are left over, so 7 fragments in total.
Offset of the last fragment = 8880 / 8 = 1110
Answer: 7 and 1110
Assume that the bandwidth for a TCP connection is 1048560 bits/sec. Let be the value of RTT in milliseconds (rounded off to the nearest integer) after which the TCP window scale option is needed. Let be the maximum possible window size with window scale option. Then the values of and are
Answer: (C)
A TCP window with no scaling can be at most 65535 bytes. The bandwidth in bytes is 1048560 / 8 = 131070 bytes/s.
The window scale option becomes necessary when bandwidth RTT is more than 65535. So RTT = 65535 / 131070 = 0.5 s = 500 ms.
The largest scale shift allowed is 14, so .
Answer: 500 milliseconds, 65535
The window scale option becomes necessary when bandwidth RTT is more than 65535. So RTT = 65535 / 131070 = 0.5 s = 500 ms.
The largest scale shift allowed is 14, so .
Answer: 500 milliseconds, 65535
Consider a simple checkpointing protocol and the following set of operations in the log.
(start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7);
(checkpoint);
(start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3), (write, T3, z, 7, 2);
If a crash happens now and the system tries to recover using both undo and redo operations, what are the contents of the undo list and the redo list?
(start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7);
(checkpoint);
(start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3), (write, T3, z, 7, 2);
If a crash happens now and the system tries to recover using both undo and redo operations, what are the contents of the undo list and the redo list?
Answer: (A)
Going through each transaction:
- T4 committed before the checkpoint it is already safe, so nothing is needed.
- T1 started before the checkpoint and did not commit undo it.
- T2 committed after the checkpoint redo it.
- T3 did not commit undo it.
Answer: Undo: T3, T1; Redo: T2
- T4 committed before the checkpoint it is already safe, so nothing is needed.
- T1 started before the checkpoint and did not commit undo it.
- T2 committed after the checkpoint redo it.
- T3 did not commit undo it.
Answer: Undo: T3, T1; Redo: T2
Consider two relations R1(A,B) with the tuples (1,5), (3,7) and R2(A,C) = (1,7), (4,9). Assume that R(A,B,C) is the full natural outer join of R1 and R2. Consider the following tuples of the form (A,B,C): a = (1,5,null), b = (1,null,7), c = (3, null, 9), d = (4,7,null), e = (1,5,7), f = (3,7,null), g = (4,null,9). Which one of the following statements is correct?
Answer: (C)
Join on A:
- A = 1 is in both tables: (1, 5, 7) e
- (3, 7) from R1 finds no partner: (3, 7, null) f
- (4, 9) from R2 finds no partner: (4, null, 9) g
A = 1 matched, so (1, 5, null) and (1, null, 7) are not in R.
Answer: R contains e, f, g but not a, b
- A = 1 is in both tables: (1, 5, 7) e
- (3, 7) from R1 finds no partner: (3, 7, null) f
- (4, 9) from R2 finds no partner: (4, null, 9) g
A = 1 matched, so (1, 5, null) and (1, null, 7) are not in R.
Answer: R contains e, f, g but not a, b
Consider six memory partitions of sizes 200 KB, 400 KB, 600 KB, 500 KB, 300 KB and 250 KB, where KB refers to kilobyte. These partitions need to be allotted to four processes of sizes 357 KB, 210 KB, 468 KB and 491 KB in that order. If the best fit algorithm is used, which partitions are NOT allotted to any process?
Answer: (A)
Best fit chooses the smallest partition that is big enough for the process:
- Process 357 partition 400
- Process 210 partition 250
- Process 468 partition 500
- Process 491 partition 600
Partitions not used: 200 KB and 300 KB
Answer: 200 KB and 300 KB
- Process 357 partition 400
- Process 210 partition 250
- Process 468 partition 500
- Process 491 partition 600
Partitions not used: 200 KB and 300 KB
Answer: 200 KB and 300 KB