GATE 2014 (Session 3)
65 questions
MCQ 47 · NAT 181-mark 30 · 2-mark 35
Questions 36–40 of 65
An IP router implementing Classless Inter-domain routing (CIDR) receives a packet with address 131.23.151.76. The router's routing table has the following entries:
The identifier of the output interface on which this packet will be forwarded is _____.
The identifier of the output interface on which this packet will be forwarded is _____.
Answer: 1
The packet address is 131.23.151.76. Its second octet is 23, which is 00010111.
- 131.16.0.0/12: 16 = 0001 0000 the first 4 bits, 0001, match.
- 131.28.0.0/14: 28 = 000111 00 compared with 000101 no match.
- 131.19.0.0/16: 19 23 no match.
- 131.22.0.0/15: 22 = 0001011 0 the first 7 bits, 0001011, match.
The longest prefix match is /15 interface 1.
Answer: 1
- 131.16.0.0/12: 16 = 0001 0000 the first 4 bits, 0001, match.
- 131.28.0.0/14: 28 = 000111 00 compared with 000101 no match.
- 131.19.0.0/16: 19 23 no match.
- 131.22.0.0/15: 22 = 0001011 0 the first 7 bits, 0001011, match.
The longest prefix match is /15 interface 1.
Answer: 1
Every host in an IPv4 network has a 1-second resolution real-time clock with battery backup. Each host needs to generate up to 1000 unique identifiers per second. Assume that each host has a globally unique IPv4 address. Design a 50-bit globally unique ID for this purpose. After what period (in seconds) will the identifiers generated by a host wrap around?
Answer: 256
Go through the parts of the ID:
- IPv4 address (for global uniqueness): 32 bits
- Up to 1000 IDs in each second: 10 bits needed ()
- Bits left for the clock: 50 32 10 = 8 bits
The clock part wraps around after seconds.
Answer: 256
- IPv4 address (for global uniqueness): 32 bits
- Up to 1000 IDs in each second: 10 bits needed ()
- Bits left for the clock: 50 32 10 = 8 bits
The clock part wraps around after seconds.
Answer: 256
An IP router with a Maximum Transmission Unit (MTU) of 1500 bytes has received an IP packet of size 4404 bytes with an IP header of length 20 bytes. The values of the relevant fields in the header of the third IP fragment generated by the router for this packet are
Answer: (A)
Find the data size: 4404 20 = 4384 B. Each fragment can carry at most 1480 B of data (a multiple of 8).
- Fragment 1: carries 1480 B, offset 0
- Fragment 2: carries 1480 B, offset 185
- Fragment 3: carries 4384 2960 = 1424 B, offset is 2960 / 8 = 370. It is the last fragment, so MF = 0
Datagram length = 1424 + 20 = 1444
Answer: MF bit: 0, Datagram Length: 1444, Offset: 370
- Fragment 1: carries 1480 B, offset 0
- Fragment 2: carries 1480 B, offset 185
- Fragment 3: carries 4384 2960 = 1424 B, offset is 2960 / 8 = 370. It is the last fragment, so MF = 0
Datagram length = 1424 + 20 = 1444
Answer: MF bit: 0, Datagram Length: 1444, Offset: 370
Consider the transactions T1, T2, and T3 and the schedules S1 and S2 given below.
T1 : r1(X); r1(Z); w1(X); w1(Z)
T2 : r2(Y); r2(Z); w2(Z)
T3 : r3(Y); r3(X); w3(Y)
S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z); w3(Y); w2(Z); r1(Z); w1(X); w1(Z)
S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z); r2(Z); w3(Y); w1(X); w2(Z); w1(Z)
Which one of the following statements about the schedules is TRUE?
T1 : r1(X); r1(Z); w1(X); w1(Z)
T2 : r2(Y); r2(Z); w2(Z)
T3 : r3(Y); r3(X); w3(Y)
S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z); w3(Y); w2(Z); r1(Z); w1(X); w1(Z)
S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z); r2(Z); w3(Y); w1(X); w2(Z); w1(Z)
Which one of the following statements about the schedules is TRUE?
Answer: (A)
Draw the precedence graph for each schedule: add when an operation of comes before a conflicting operation of on the same item.
S1: r2(Y) comes before w3(Y), so . r3(X) comes before w1(X), so . r2(Z) and w2(Z) come before r1(Z) and w1(Z), so . The graph has no cycle, so S1 is conflict serializable (order ).
S2: r1(Z) comes before w2(Z), so . r2(Z) comes before w1(Z), so . The graph has a cycle, so S2 is not conflict serializable.
Answer: (A)
S1: r2(Y) comes before w3(Y), so . r3(X) comes before w1(X), so . r2(Z) and w2(Z) come before r1(Z) and w1(Z), so . The graph has no cycle, so S1 is conflict serializable (order ).
S2: r1(Z) comes before w2(Z), so . r2(Z) comes before w1(Z), so . The graph has a cycle, so S2 is not conflict serializable.
Answer: (A)
Consider the relational schema given below, where eId of the relation dependentis a foreign key referring to empId of the relation employee. Assume that every employee has at least one associated dependent in the dependent relation.
The above query evaluates to the set of empIds of employees whose age is greater than that of
employee (empId, empName, empAge)
dependent(depId, eId, depName, depAge) Consider the following relational algebra query:The above query evaluates to the set of empIds of employees whose age is greater than that of
Answer: (D)
The join picks the employees who have at least one dependent of their own (eId = empId) whose age is the employee's age.
When we take these away from the set of all employees, we are left with the employees who are older than every one of their own dependents.
Answer: all of his/her dependents
When we take these away from the set of all employees, we are left with the employees who are older than every one of their own dependents.
Answer: all of his/her dependents