GATE 2006
191 questions
MCQ 1911-mark 191
Questions 181–185 of 191
For which one of the following reason does Internet Protocol (IP) use the time-to-live (TTL) field in the IP datagram header?
Answer: (C)
The TTL field in the IPv4 header is one byte, so it holds a value from to . The sender sets it, and every router that forwards the packet decreases it by 1. When it reaches 0 the packet is discarded.
IP is connectionless, and a routing loop can make a packet circle the network for ever, which would use up bandwidth and make the network unstable. TTL puts an upper limit on the number of hops, so a looping packet is eventually dropped.
- (A) is wrong. TTL does not guarantee delivery in any time.
- (B) is wrong. A packet is dropped when its TTL reaches 0, not because it arrives late.
- (D) is wrong. TTL counts forwarding hops. It does not limit how long a packet waits in a router queue.
Answer: (C)
IP is connectionless, and a routing loop can make a packet circle the network for ever, which would use up bandwidth and make the network unstable. TTL puts an upper limit on the number of hops, so a looping packet is eventually dropped.
- (A) is wrong. TTL does not guarantee delivery in any time.
- (B) is wrong. A packet is dropped when its TTL reaches 0, not because it arrives late.
- (D) is wrong. TTL counts forwarding hops. It does not limit how long a packet waits in a router queue.
Answer: (C)
A program on machine X attempts to open a UDP connection to port 5376 on a machine Y, and a TCP connection to port 8632 on machine Z. However, there are no applications listening at the corresponding ports on Y and Z. An ICMP Port Unreachable error will be generated by
Answer: (A)
UDP to Y: UDP has no way to answer by itself when no application listens on the port. The host on Y sends an ICMP Destination Unreachable message with code 3 (Port Unreachable). So Y generates it.
TCP to Z: TCP handles a closed port inside the protocol. Z answers the SYN with a TCP segment that has the RST (reset) flag set. No ICMP message is sent.
So an ICMP Port Unreachable comes from Y but not from Z.
Answer: (A)
TCP to Z: TCP handles a closed port inside the protocol. Z answers the SYN with a TCP segment that has the RST (reset) flag set. No ICMP message is sent.
So an ICMP Port Unreachable comes from Y but not from Z.
Answer: (A)
HELO and PORT, respectively, are commands from the protocols:
Answer: (D)
- HELO is the greeting command a client sends to start an SMTP session (it gives the client's host name to the mail server).
- PORT is an FTP command. The client uses it to tell the server which IP address and port to use for the data connection (active mode).
So the pair is SMTP and FTP. HELO does not belong to FTP, TELNET or HTTP, and PORT does not belong to HTTP, POP3 or TELNET, so the other options fail.
Answer: (D)
- PORT is an FTP command. The client uses it to tell the server which IP address and port to use for the data connection (active mode).
So the pair is SMTP and FTP. HELO does not belong to FTP, TELNET or HTTP, and PORT does not belong to HTTP, POP3 or TELNET, so the other options fail.
Answer: (D)
Which of the following statement(s) is TRUE?
I. A hash function takes a message of arbitrary length and generates a fixed length code.
II. A hash function takes a message of fixed length and generates a code of variable length.
III. A hash function may give the same hash value for distinct messages.
I. A hash function takes a message of arbitrary length and generates a fixed length code.
II. A hash function takes a message of fixed length and generates a code of variable length.
III. A hash function may give the same hash value for distinct messages.
Answer: (C)
Statement I is true: a hash function takes a message of any length and gives a code of fixed length.
Statement II is false: the input is not limited to a fixed length, and the output length is fixed, not variable.
Statement III is true: the possible messages are far more than the possible codes, so two different messages can have the same hash (a collision). For example, gives the same value for 1 and 11. Cryptographic hash functions also have collisions, but they are hard to find.
Answer: (C)
Statement II is false: the input is not limited to a fixed length, and the output length is fixed, not variable.
Statement III is true: the possible messages are far more than the possible codes, so two different messages can have the same hash (a collision). For example, gives the same value for 1 and 11. Cryptographic hash functions also have collisions, but they are hard to find.
Answer: (C)
A software project has four phases P1, P2, P3 and P4. Of these phases, P1 Is the first one and needs to be completed before any other phase can commence. Phases P2 and P3 can be executed in parallel. Phase P4 cannot commence until both P2 and P3 are completed. The optimistic, most likely, and pessimistic estimates of the phase completion times in days, for Pl, P2, P3 and P4 are, respectively, (11, 15, 25), (7, 8, 15), (8, 9, 22), and (3, 8, 19). The costs (in Rupees per day) of crashing the expected phase completion times for the four phases, respectively, are 100, 2000, 50, and 1000. Assume that the expected phase completion times of the phases cannot be crashed below their respective most likely completion times. The minimum and the maximum amounts (in Rupees) that can be spent on crashing so that ALL paths are critical are, respectively.
Answer: (B)
Expected time of a phase: .
, , , days.
Paths: P1-P3-P4 = 16 + 11 + 9 = 36 days, P1-P2-P4 = 16 + 9 + 9 = 34 days. P1-P3-P4 is critical.
Phases cannot be crashed below their most likely time, so the most crashing available is: P1 by 1 day (Rs 100/day), P2 by 1 day (Rs 2000/day), P3 by 2 days (Rs 50/day), P4 by 1 day (Rs 1000/day).
Minimum: both paths must have the same length. Crash P3 by 2 days: that path becomes 34 days, equal to the other. Cost = 2 x 50 = Rs 100.
Maximum: P3 is already at its limit (9 days), so P2 cannot be crashed, or the P2 path would become shorter than the P3 path. P1 and P4 lie on both paths, so crashing them keeps the paths equal. Crash P1 by 1 day (Rs 100) and P4 by 1 day (Rs 1000) as well. Both paths are now 32 days. Cost = 100 + 100 + 1000 = Rs 1200.
Answer: (B)
, , , days.
Paths: P1-P3-P4 = 16 + 11 + 9 = 36 days, P1-P2-P4 = 16 + 9 + 9 = 34 days. P1-P3-P4 is critical.
Phases cannot be crashed below their most likely time, so the most crashing available is: P1 by 1 day (Rs 100/day), P2 by 1 day (Rs 2000/day), P3 by 2 days (Rs 50/day), P4 by 1 day (Rs 1000/day).
Minimum: both paths must have the same length. Crash P3 by 2 days: that path becomes 34 days, equal to the other. Cost = 2 x 50 = Rs 100.
Maximum: P3 is already at its limit (9 days), so P2 cannot be crashed, or the P2 path would become shorter than the P3 path. P1 and P4 lie on both paths, so crashing them keeps the paths equal. Crash P1 by 1 day (Rs 100) and P4 by 1 day (Rs 1000) as well. Both paths are now 32 days. Cost = 100 + 100 + 1000 = Rs 1200.
Answer: (B)