GATE 2025 (Session 2)
65 questions
MCQ 32 · MSQ 18 · NAT 151-mark 30 · 2-mark 35
Questions 16–20 of 65
Consider the following statements:
(i) Address Resolution Protocol (ARP) provides a mapping from an IP address to the corresponding hardware (link-layer) address.
(ii) A single TCP segment from a sender S to a receiver R cannot carry both data from S to R and acknowledgement for a segment from R to S.
Which ONE of the following is CORRECT?
(i) Address Resolution Protocol (ARP) provides a mapping from an IP address to the corresponding hardware (link-layer) address.
(ii) A single TCP segment from a sender S to a receiver R cannot carry both data from S to R and acknowledgement for a segment from R to S.
Which ONE of the following is CORRECT?
Answer: (B)
Statement (i): ARP maps an IP address to a hardware (MAC) address. This is the definition of ARP, so the statement is TRUE.
Statement (ii): "A single TCP segment cannot carry both data and an acknowledgement." This is FALSE. TCP is full-duplex. A common method called piggybacking lets one segment carry new data (from S to R) and also an acknowledgement for data received earlier from R. The TCP header always has an ACK field, whether or not the segment carries data.
Answer: (i) is TRUE and (ii) is FALSE
Statement (ii): "A single TCP segment cannot carry both data and an acknowledgement." This is FALSE. TCP is full-duplex. A common method called piggybacking lets one segment carry new data (from S to R) and also an acknowledgement for data received earlier from R. The TCP header always has an ACK field, whether or not the segment carries data.
Answer: (i) is TRUE and (ii) is FALSE
Consider the routing protocols given in List I and the names given in List II:
For matching of items in List I with those in List II, which ONE of the following options is CORRECT?
For matching of items in List I with those in List II, which ONE of the following options is CORRECT?
Answer: (A)
Distance vector routing is the distributed, practical form of the Bellman-Ford shortest-path algorithm. Each router knows only the distances given by its neighbors. It updates them again and again.
Link state routing needs every router to know the full topology. Each router then finds shortest paths with Dijkstra's algorithm.
Answer: (i)-(a) and (ii)-(b)
Link state routing needs every router to know the full topology. Each router then finds shortest paths with Dijkstra's algorithm.
Answer: (i)-(a) and (ii)-(b)
A machine receives an IPv4 datagram. The protocol field of the IPv4 header has the protocol number of a protocol X.
Which ONE of the following is NOT a possible candidate for X?
Which ONE of the following is NOT a possible candidate for X?
Answer: (D)
The protocol field in the IPv4 header tells which higher-layer protocol the datagram carries. It uses standard registered numbers. These are: ICMP , IGMP , OSPF . All three work directly on top of IP, and each has its own protocol number.
RIP is different. It is not carried directly by IP. It is an application-layer protocol that works over UDP (UDP port ). So an IP datagram with RIP traffic has the protocol field set to the UDP number (). It never has a separate "RIP" protocol number.
Answer: Routing Information Protocol (RIP)
RIP is different. It is not carried directly by IP. It is an application-layer protocol that works over UDP (UDP port ). So an IP datagram with RIP traffic has the protocol field set to the UDP number (). It never has a separate "RIP" protocol number.
Answer: Routing Information Protocol (RIP)
Consider the following C program:
#include <stdio.h>
void stringcopy(char *, char *);
int main(){
char a[30] = "@#Hello World!";
stringcopy(a, a + 2);
printf("%s\n", a);
return 0;
}
void stringcopy(char *s, char *t) {
while(*t)
*s++ = *t++;
}
Which ONE of the following will be the output of the program?Answer: (D)
The string @#Hello World! has 14 characters at indices to , and the null character '\0' is at index .
In the call, points to index and points to index . The loop copies to and moves both pointers, and it stops when is null. So it copies indices to (12 characters, Hello World!) into indices to .
The loop ends before the null at index is copied, so no new null is written. Indices , and keep their old values d, ! and '\0'.
printf with %s prints from index up to the first null at index : Hello World! followed by the leftover d!.
Answer: (D)
In the call, points to index and points to index . The loop copies to and moves both pointers, and it stops when is null. So it copies indices to (12 characters, Hello World!) into indices to .
The loop ends before the null at index is copied, so no new null is written. Indices , and keep their old values d, ! and '\0'.
printf with %s prints from index up to the first null at index : Hello World! followed by the leftover d!.
Answer: (D)
Consider an unordered list of distinct integers.
What is the minimum number of element comparisons required to find an integer in the list that is NOT the largest in the list?
What is the minimum number of element comparisons required to find an integer in the list that is NOT the largest in the list?
Answer: (A)
We only need to find some element that is surely not the largest in the whole list. We do not need to find the largest element. We also do not need to check the rest of the list.
Pick any two elements and compare them. The smaller one is guaranteed to not be the maximum of the list, because the larger one of the pair is bigger than it. This takes only one comparison. It works for any list of distinct integers.
Answer: 1
Pick any two elements and compare them. The smaller one is guaranteed to not be the maximum of the list, because the larger one of the pair is bigger than it. This takes only one comparison. It works for any list of distinct integers.
Answer: 1